diff options
| author | beepster4096 <19316085+beepster4096@users.noreply.github.com> | 2024-04-27 23:09:43 -0700 |
|---|---|---|
| committer | beepster4096 <19316085+beepster4096@users.noreply.github.com> | 2024-06-14 21:56:51 -0700 |
| commit | 58b065eb4423d2075f5478b05e287dbbb8470ca0 (patch) | |
| tree | 1a1745dc6672a13a12123897559c4df6e6900b97 | |
| parent | 3fc81daffd18aa1fc00a1d67cfaca12a32a07e46 (diff) | |
| download | rust-58b065eb4423d2075f5478b05e287dbbb8470ca0.tar.gz rust-58b065eb4423d2075f5478b05e287dbbb8470ca0.zip | |
make uninitialized_error_reported a set of locals
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/lib.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index 8200a58f31f..fb3d17777a5 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -100,12 +100,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { move_site_vec.iter().map(|move_site| move_site.moi).collect(); if move_out_indices.is_empty() { - let root_place = PlaceRef { projection: &[], ..used_place }; + let root_local = used_place.local; - if !self.uninitialized_error_reported.insert(root_place) { + if !self.uninitialized_error_reported.insert(root_local) { debug!( "report_use_of_moved_or_uninitialized place: error about {:?} suppressed", - root_place + root_local ); return; } diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 5c9826ecca7..b3b53e9cb79 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -566,7 +566,7 @@ struct MirBorrowckCtxt<'cx, 'tcx> { fn_self_span_reported: FxIndexSet<Span>, /// This field keeps track of errors reported in the checking of uninitialized variables, /// so that we don't report seemingly duplicate errors. - uninitialized_error_reported: FxIndexSet<PlaceRef<'tcx>>, + uninitialized_error_reported: FxIndexSet<Local>, /// This field keeps track of all the local variables that are declared mut and are mutated. /// Used for the warning issued by an unused mutable local variable. used_mut: FxIndexSet<Local>, |
