Skip to content

Commit 58b065e

Browse files
committed
make uninitialized_error_reported a set of locals
1 parent 3fc81da commit 58b065e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
100100
move_site_vec.iter().map(|move_site| move_site.moi).collect();
101101

102102
if move_out_indices.is_empty() {
103-
let root_place = PlaceRef { projection: &[], ..used_place };
103+
let root_local = used_place.local;
104104

105-
if !self.uninitialized_error_reported.insert(root_place) {
105+
if !self.uninitialized_error_reported.insert(root_local) {
106106
debug!(
107107
"report_use_of_moved_or_uninitialized place: error about {:?} suppressed",
108-
root_place
108+
root_local
109109
);
110110
return;
111111
}

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ struct MirBorrowckCtxt<'cx, 'tcx> {
566566
fn_self_span_reported: FxIndexSet<Span>,
567567
/// This field keeps track of errors reported in the checking of uninitialized variables,
568568
/// so that we don't report seemingly duplicate errors.
569-
uninitialized_error_reported: FxIndexSet<PlaceRef<'tcx>>,
569+
uninitialized_error_reported: FxIndexSet<Local>,
570570
/// This field keeps track of all the local variables that are declared mut and are mutated.
571571
/// Used for the warning issued by an unused mutable local variable.
572572
used_mut: FxIndexSet<Local>,

0 commit comments

Comments
 (0)