about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/errors.rs
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@users.noreply.github.com>2025-05-20 07:15:48 +0000
committerGitHub <noreply@github.com>2025-05-20 07:15:48 +0000
commit2147783b79641e76a7e5edde92d01ab2b7b1c929 (patch)
treef3320b3f6da82ecd6addc82012c3800de01aa3d2 /compiler/rustc_pattern_analysis/src/errors.rs
parenta1d75fb0d092355557fefed43ceb1bea1432400c (diff)
parenta6674952979445a81a890a936d968f81cf766c61 (diff)
downloadrust-2147783b79641e76a7e5edde92d01ab2b7b1c929.tar.gz
rust-2147783b79641e76a7e5edde92d01ab2b7b1c929.zip
Merge pull request #19826 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/errors.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler/rustc_pattern_analysis/src/errors.rs b/compiler/rustc_pattern_analysis/src/errors.rs
index e60930d6cd2..156ba973767 100644
--- a/compiler/rustc_pattern_analysis/src/errors.rs
+++ b/compiler/rustc_pattern_analysis/src/errors.rs
@@ -1,5 +1,5 @@
 use rustc_errors::{Diag, EmissionGuarantee, Subdiagnostic};
-use rustc_macros::{LintDiagnostic, Subdiagnostic};
+use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
 use rustc_middle::ty::Ty;
 use rustc_span::Span;
 
@@ -133,3 +133,15 @@ pub(crate) struct NonExhaustiveOmittedPatternLintOnArm {
     pub lint_level: &'static str,
     pub lint_name: &'static str,
 }
+
+#[derive(Diagnostic)]
+#[diag(pattern_analysis_mixed_deref_pattern_constructors)]
+pub(crate) struct MixedDerefPatternConstructors<'tcx> {
+    #[primary_span]
+    pub spans: Vec<Span>,
+    pub smart_pointer_ty: Ty<'tcx>,
+    #[label(pattern_analysis_deref_pattern_label)]
+    pub deref_pattern_label: Span,
+    #[label(pattern_analysis_normal_constructor_label)]
+    pub normal_constructor_label: Span,
+}