1
Fork 0

Migrate memory overlap check from validator to lint

The check attempts to identify potential undefined behaviour, rather
than whether MIR is well-formed. It belongs in the lint not validator.
This commit is contained in:
Tomasz Miąsko 2024-01-04 14:24:41 +01:00
parent a084e063e6
commit df116ec246
8 changed files with 85 additions and 237 deletions

View file

@ -133,7 +133,6 @@
use std::collections::hash_map::{Entry, OccupiedEntry};
use crate::simplify::remove_dead_blocks;
use crate::MirPass;
use rustc_data_structures::fx::FxHashMap;
use rustc_index::bit_set::BitSet;
@ -241,12 +240,6 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
apply_merges(body, tcx, &merges, &merged_locals);
}
if round_count != 0 {
// Merging can introduce overlap between moved arguments and/or call destination in an
// unreachable code, which validator considers to be ill-formed.
remove_dead_blocks(body);
}
trace!(round_count);
}
}