about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-01-28 12:07:36 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-02-02 19:30:53 +0000
commit7e4ccc2f12f29a5c12c5669afd25b7e0481baf52 (patch)
treec857f221ab91eb6626eaa894c7055f50a8ca0a3d /compiler/rustc_hir_analysis/src/errors
parentded0836c18a0b25f076ee776e1c9eeb989272f3b (diff)
downloadrust-7e4ccc2f12f29a5c12c5669afd25b7e0481baf52.tar.gz
rust-7e4ccc2f12f29a5c12c5669afd25b7e0481baf52.zip
Maintain a list of types permitted per pattern
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors')
-rw-r--r--compiler/rustc_hir_analysis/src/errors/pattern_types.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors/pattern_types.rs b/compiler/rustc_hir_analysis/src/errors/pattern_types.rs
index bb771d6ea17..272edbe841b 100644
--- a/compiler/rustc_hir_analysis/src/errors/pattern_types.rs
+++ b/compiler/rustc_hir_analysis/src/errors/pattern_types.rs
@@ -1,4 +1,5 @@
 use rustc_macros::Diagnostic;
+use rustc_middle::ty::Ty;
 use rustc_span::Span;
 
 #[derive(Diagnostic)]
@@ -7,3 +8,14 @@ pub(crate) struct WildPatTy {
     #[primary_span]
     pub span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis_invalid_base_type)]
+pub(crate) struct InvalidBaseType<'tcx> {
+    pub ty: Ty<'tcx>,
+    #[primary_span]
+    pub ty_span: Span,
+    pub pat: &'static str,
+    #[note]
+    pub pat_span: Span,
+}