mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 12:46:43 +00:00
fix: remove Clone trait bounds from diagnostics iterators (#2136)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This requires new release of world crates, while we didn't plan it.
This commit is contained in:
parent
d2a747372f
commit
53488dad22
4 changed files with 6 additions and 6 deletions
|
|
@ -57,7 +57,7 @@ pub struct KnownIssues {
|
||||||
impl KnownIssues {
|
impl KnownIssues {
|
||||||
/// Collects known lint issues from the given compiler diagnostics.
|
/// Collects known lint issues from the given compiler diagnostics.
|
||||||
pub fn from_compiler_diagnostics<'a>(
|
pub fn from_compiler_diagnostics<'a>(
|
||||||
diags: impl Iterator<Item = &'a SourceDiagnostic> + Clone,
|
diags: impl Iterator<Item = &'a SourceDiagnostic>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let mut unknown_vars = Vec::default();
|
let mut unknown_vars = Vec::default();
|
||||||
for diag in diags {
|
for diag in diags {
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ impl<F: CompilerFeat> CompiledArtifact<F> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the diagnostics.
|
/// Returns the diagnostics.
|
||||||
pub fn diagnostics(&self) -> impl Iterator<Item = &typst::diag::SourceDiagnostic> + Clone {
|
pub fn diagnostics(&self) -> impl Iterator<Item = &typst::diag::SourceDiagnostic> {
|
||||||
self.diag.diagnostics()
|
self.diag.diagnostics()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ impl SemanticRequest for CheckRequest {
|
||||||
|
|
||||||
fn request(self, ctx: &mut LocalContext) -> Option<Self::Response> {
|
fn request(self, ctx: &mut LocalContext) -> Option<Self::Response> {
|
||||||
let worker = DiagWorker::new(ctx);
|
let worker = DiagWorker::new(ctx);
|
||||||
let compiler_diags = self.snap.diagnostics();
|
let compiler_diags = || self.snap.diagnostics();
|
||||||
|
|
||||||
let known_issues = KnownIssues::from_compiler_diagnostics(compiler_diags.clone());
|
let known_issues = KnownIssues::from_compiler_diagnostics(compiler_diags());
|
||||||
Some(worker.check(&known_issues).convert_all(compiler_diags))
|
Some(worker.check(&known_issues).convert_all(compiler_diags()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,7 @@ impl DiagnosticsTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the diagnostics.
|
/// Gets the diagnostics.
|
||||||
pub fn diagnostics(&self) -> impl Iterator<Item = &typst::diag::SourceDiagnostic> + Clone {
|
pub fn diagnostics(&self) -> impl Iterator<Item = &typst::diag::SourceDiagnostic> {
|
||||||
self.paged
|
self.paged
|
||||||
.errors
|
.errors
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue