about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/errors.rs
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2025-02-04 03:18:10 -0800
committerdianne <diannes.gm@gmail.com>2025-02-04 03:18:10 -0800
commit203d3109d8e96a6a4075205e836216d7cd281d5b (patch)
tree80f3bb3d03da444efad5df7b0fdbed276d0d0cad /compiler/rustc_mir_build/src/errors.rs
parent4331f55b729d1a41004305f85dfe4dbbcec3ee3f (diff)
downloadrust-203d3109d8e96a6a4075205e836216d7cd281d5b.tar.gz
rust-203d3109d8e96a6a4075205e836216d7cd281d5b.zip
experimentally label the spans for default binding modes
Diffstat (limited to 'compiler/rustc_mir_build/src/errors.rs')
-rw-r--r--compiler/rustc_mir_build/src/errors.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs
index 0289a6c4073..e37fe826784 100644
--- a/compiler/rustc_mir_build/src/errors.rs
+++ b/compiler/rustc_mir_build/src/errors.rs
@@ -1,3 +1,4 @@
+use rustc_data_structures::fx::FxIndexMap;
 use rustc_errors::codes::*;
 use rustc_errors::{
     Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level,
@@ -1109,6 +1110,11 @@ pub(crate) struct Rust2024IncompatiblePatSugg {
     pub(crate) suggestion: Vec<(Span, String)>,
     pub(crate) ref_pattern_count: usize,
     pub(crate) binding_mode_count: usize,
+    /// Internal state: the ref-mutability of the default binding mode at the subpattern being
+    /// lowered, with the span where it was introduced. `None` for a by-value default mode.
+    pub(crate) default_mode_span: Option<(Span, ty::Mutability)>,
+    /// Labels for where incompatibility-causing by-ref default binding modes were introduced.
+    pub(crate) default_mode_labels: FxIndexMap<Span, ty::Mutability>,
 }
 
 impl Subdiagnostic for Rust2024IncompatiblePatSugg {