Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ca513cb

Browse files
authoredJun 15, 2024
Unrolled build for rust-lang#126508
Rollup merge of rust-lang#126508 - beepster4096:minor_borrowck_cherrypick, r=compiler-errors Make uninitialized_error_reported a set of locals Another artifact of how places used to be able to be based on statics and not just locals. This set is exclusively filled with PlaceRefs that are just locals, so it should just contain locals directly.
2 parents 92af831 + 58b065e commit ca513cb

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)
Failed to load comments.