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

This requires new release of world crates, while we didn't plan it.
This commit is contained in:
Myriad-Dreamin 2025-09-27 17:02:06 +08:00 committed by GitHub
parent d2a747372f
commit 53488dad22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View file

@ -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 {

View file

@ -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()
} }

View file

@ -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()))
} }
} }

View file

@ -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()