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:
Aaron Hill 2022-05-09 22:48:43 -04:00
parent 08b4f1be33
commit 6b747aa397
No known key found for this signature in database
GPG key ID: B4087E510E98B164
4 changed files with 15 additions and 5 deletions

View file

@ -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(