about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-04-04 15:06:30 -0400
committerMichael Goulet <michael@errs.io>2024-04-15 16:45:26 -0400
commitce8961039e244b1e4e0fa02fc10d59a22abc9ea3 (patch)
tree82e0bc2d330f071eb561dc164c60f1385f7fadbc /compiler/rustc_hir_analysis/src/errors
parent02d7317af218343818dcb107cda80750e9604a3a (diff)
Some ordering and duplication checks
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors')
-rw-r--r--compiler/rustc_hir_analysis/src/errors/precise_captures.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors/precise_captures.rs b/compiler/rustc_hir_analysis/src/errors/precise_captures.rs
index 3b22437abb2..e2eb9c72bf2 100644
--- a/compiler/rustc_hir_analysis/src/errors/precise_captures.rs
+++ b/compiler/rustc_hir_analysis/src/errors/precise_captures.rs
@@ -1,5 +1,5 @@
 use rustc_macros::Diagnostic;
-use rustc_span::Span;
+use rustc_span::{Span, Symbol};
 
 #[derive(Diagnostic)]
 #[diag(hir_analysis_param_not_captured)]
@@ -31,3 +31,23 @@ pub struct BadPreciseCapture {
     pub kind: &'static str,
     pub found: String,
 }
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis_duplicate_precise_capture)]
+pub struct DuplicatePreciseCapture {
+    #[primary_span]
+    pub first_span: Span,
+    pub name: Symbol,
+    #[label]
+    pub second_span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis_lifetime_must_be_first)]
+pub struct LifetimesMustBeFirst {
+    #[primary_span]
+    pub lifetime_span: Span,
+    pub name: Symbol,
+    #[label]
+    pub other_span: Span,
+}