diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2022-05-09 22:48:43 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2022-05-11 16:22:23 -0400 |
| commit | 6b747aa397c7ed95f8ee53195ada25f8d9ee953d (patch) | |
| tree | c6aa2b6a90c926b20c17402d4641f2461bfb8940 /compiler/rustc_const_eval/src/transform | |
| parent | 08b4f1be33607fc4f18ce19cfd475ac9f43213fc (diff) | |
| download | rust-6b747aa397c7ed95f8ee53195ada25f8d9ee953d.tar.gz rust-6b747aa397c7ed95f8ee53195ada25f8d9ee953d.zip | |
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.
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/validate.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs index 25209e20e99..3ce33d547c5 100644 --- a/compiler/rustc_const_eval/src/transform/validate.rs +++ b/compiler/rustc_const_eval/src/transform/validate.rs @@ -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( |
