1
Fork 0

Rollup merge of #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.
This commit is contained in:
Guillaume Gomez 2024-06-15 19:51:37 +02:00 committed by GitHub
commit 53364c3e07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}