-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Remove PartialOrd
, Ord
from DefId
#90749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3360653
8bc7878
a8fc79b
f0fce21
9f0d58f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1089,7 +1089,7 @@ rustc_queries! { | |
} | ||
|
||
/// Return all `impl` blocks in the current crate. | ||
query all_local_trait_impls(_: ()) -> &'tcx BTreeMap<DefId, Vec<LocalDefId>> { | ||
query all_local_trait_impls(_: ()) -> &'tcx FxHashMap<DefId, Vec<LocalDefId>> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible iteration order matters here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly... Here are the uses of
There are quite a few There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the iteration order matters, we may need to use an FxIndexMap and audit how these maps are built. |
||
desc { "local trait impls" } | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -35,9 +35,8 @@ use crate::ty::{self, flags::FlagComputation, Binder, Ty, TyCtxt, TypeFlags}; | |||
use rustc_hir as hir; | ||||
use rustc_hir::def_id::DefId; | ||||
|
||||
use rustc_data_structures::fx::FxHashSet; | ||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; | ||||
use rustc_data_structures::sso::SsoHashSet; | ||||
use std::collections::BTreeMap; | ||||
use std::fmt; | ||||
use std::ops::ControlFlow; | ||||
|
||||
|
@@ -695,12 +694,12 @@ impl<'tcx> TyCtxt<'tcx> { | |||
self, | ||||
value: Binder<'tcx, T>, | ||||
mut fld_r: F, | ||||
) -> (T, BTreeMap<ty::BoundRegion, ty::Region<'tcx>>) | ||||
) -> (T, FxHashMap<ty::BoundRegion, ty::Region<'tcx>>) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this FxHashMap used anyhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe not? 👀 🤔 I'm not entirely sure how to check. The
|
||||
where | ||||
F: FnMut(ty::BoundRegion) -> ty::Region<'tcx>, | ||||
T: TypeFoldable<'tcx>, | ||||
{ | ||||
let mut region_map = BTreeMap::new(); | ||||
let mut region_map = FxHashMap::default(); | ||||
let mut real_fld_r = | ||||
|br: ty::BoundRegion| *region_map.entry(br).or_insert_with(|| fld_r(br)); | ||||
let value = value.skip_binder(); | ||||
|
@@ -747,14 +746,14 @@ impl<'tcx> TyCtxt<'tcx> { | |||
mut fld_r: F, | ||||
fld_t: G, | ||||
fld_c: H, | ||||
) -> (T, BTreeMap<ty::BoundRegion, ty::Region<'tcx>>) | ||||
) -> (T, FxHashMap<ty::BoundRegion, ty::Region<'tcx>>) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does any use site rely on the iteration order? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe here?
|
||||
where | ||||
F: FnMut(ty::BoundRegion) -> ty::Region<'tcx>, | ||||
G: FnMut(ty::BoundTy) -> Ty<'tcx>, | ||||
H: FnMut(ty::BoundVar, Ty<'tcx>) -> &'tcx ty::Const<'tcx>, | ||||
T: TypeFoldable<'tcx>, | ||||
{ | ||||
let mut region_map = BTreeMap::new(); | ||||
let mut region_map = FxHashMap::default(); | ||||
let real_fld_r = |br: ty::BoundRegion| *region_map.entry(br).or_insert_with(|| fld_r(br)); | ||||
let value = self.replace_escaping_bound_vars(value.skip_binder(), real_fld_r, fld_t, fld_c); | ||||
(value, region_map) | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does any code depend on the iteration order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes:
rust/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
Line 189 in 181e915
rust/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
Line 229 in 181e915
rust/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
Line 449 in 181e915
rust/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
Line 618 in 181e915
rust/compiler/rustc_trait_selection/src/traits/auto_trait.rs
Line 515 in 181e915