Remove PartialOrd
/Ord
impl for PlaceRef
This is a new attempt at #93315. It removes one usage of the `Ord` impl for `DefId`, which should make it easier to eventually remove that impl.
This commit is contained in:
parent
08b4f1be33
commit
6b747aa397
4 changed files with 15 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
//! Validates the MIR to ensure that invariants are upheld.
|
||||
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_infer::infer::TyCtxtInferExt;
|
||||
use rustc_middle::mir::interpret::Scalar;
|
||||
|
@ -701,8 +702,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
let all_len = self.place_cache.len();
|
||||
self.place_cache.sort_unstable();
|
||||
self.place_cache.dedup();
|
||||
let mut dedup = FxHashSet::default();
|
||||
self.place_cache.retain(|p| dedup.insert(*p));
|
||||
let has_duplicates = all_len != self.place_cache.len();
|
||||
if has_duplicates {
|
||||
self.fail(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue