about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-08-23 20:54:02 +0000
committerMichael Goulet <michael@errs.io>2025-08-23 22:11:43 +0000
commite4557f0ea4f7e015b3108dc509bce562f64528bc (patch)
treea61c489f78764e258dd646a7f8a458f33fd8e1e7 /compiler/rustc_lint/src
parent6d6a08cf590ec26296447b8d2cf2329bb64c303a (diff)
downloadrust-e4557f0ea4f7e015b3108dc509bce562f64528bc.tar.gz
rust-e4557f0ea4f7e015b3108dc509bce562f64528bc.zip
Use unnamed lifetime spans as primary spans for MISMATCHED_LIFETIME_SYNTAXES
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/lifetime_syntax.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/lifetime_syntax.rs b/compiler/rustc_lint/src/lifetime_syntax.rs
index 464f4fc34b9..413525eb6e5 100644
--- a/compiler/rustc_lint/src/lifetime_syntax.rs
+++ b/compiler/rustc_lint/src/lifetime_syntax.rs
@@ -214,9 +214,9 @@ impl<T> LifetimeSyntaxCategories<Vec<T>> {
         }
     }
 
-    pub fn flatten(&self) -> impl Iterator<Item = &T> {
-        let Self { hidden, elided, named } = self;
-        [hidden.iter(), elided.iter(), named.iter()].into_iter().flatten()
+    pub fn iter_unnamed(&self) -> impl Iterator<Item = &T> {
+        let Self { hidden, elided, named: _ } = self;
+        [hidden.iter(), elided.iter()].into_iter().flatten()
     }
 }
 
@@ -495,7 +495,7 @@ fn emit_mismatch_diagnostic<'tcx>(
 
     cx.emit_span_lint(
         MISMATCHED_LIFETIME_SYNTAXES,
-        inputs.flatten().copied().collect::<Vec<_>>(),
+        inputs.iter_unnamed().chain(outputs.iter_unnamed()).copied().collect::<Vec<_>>(),
         lints::MismatchedLifetimeSyntaxes { inputs, outputs, suggestions },
     );
 }