]> git.lizzy.rs Git - rust.git/commit
Reduce the scope of allow(rustc::potential_query_instability) in rustc_trait_selection
authorCastilloDel <delcastillodelarosadaniel@gmail.com>
Fri, 28 Oct 2022 21:32:41 +0000 (23:32 +0200)
committerCastilloDel <delcastillodelarosadaniel@gmail.com>
Tue, 8 Nov 2022 18:41:48 +0000 (19:41 +0100)
commit755ca4b9aa064b77fa8a0f6cdaf050b768d844bc
treecb2ba809ef662ec220857fa38c98c03db3b3dc3e
parentddfe1e87f7c85c03773c29180a931447fcd03b65
Reduce the scope of allow(rustc::potential_query_instability) in rustc_trait_selection

Make InferCtxtExt use a FxIndexMap

This should be faster, because the map is only being used to iterate,
which is supposed to be faster with the IndexMap

Make the user_computed_preds use an IndexMap

It is being used mostly for iteration, so the change shouldn't result in
a perf hit

Make the RegionDeps fields use an IndexMap

This change could be a perf hit. Both `larger` and `smaller` are used
for iteration, but they are also used for insertions.

Make types_without_default_bounds use an IndexMap

It uses extend, but it also iterates and removes items. Not sure if
this will be a perf hit.

Make InferTtxt.reported_trait_errors use an IndexMap

This change brought a lot of other changes. The map seems to have been
mostly used for iteration, so the performance shouldn't suffer.

Add FIXME to change ProvisionalEvaluationCache.map to use an IndexMap

Right now this results in a perf hit. IndexMap doesn't have
the `drain_filter` API, so in `on_completion` we now need to iterate two
times over the map.
compiler/rustc_hir_analysis/src/check/compare_method.rs
compiler/rustc_hir_analysis/src/check/wfcheck.rs
compiler/rustc_infer/src/infer/mod.rs
compiler/rustc_trait_selection/src/lib.rs
compiler/rustc_trait_selection/src/traits/auto_trait.rs
compiler/rustc_trait_selection/src/traits/engine.rs
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
compiler/rustc_trait_selection/src/traits/select/mod.rs
compiler/rustc_trait_selection/src/traits/specialize/mod.rs