diff options
| author | bors <bors@rust-lang.org> | 2024-04-07 02:07:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-07 02:07:20 +0000 |
| commit | 087ae978a13013800c8a484cf17c8951ab0b6b0c (patch) | |
| tree | 6949e1b343d2b113161d3379c6fe4c56c716b768 /compiler/rustc_middle/src/query | |
| parent | 6f837503aa120ca69c2985b6c9a474c00674cef1 (diff) | |
| parent | 94d61d899f1ce6a8178385447740600d64aa1dae (diff) | |
| download | rust-087ae978a13013800c8a484cf17c8951ab0b6b0c.tar.gz rust-087ae978a13013800c8a484cf17c8951ab0b6b0c.zip | |
Auto merge of #123058 - lukas-code:clauses, r=lcnr
[perf] cache type info for ParamEnv This is an attempt to mitigate some of the perf regressions in https://github.com/rust-lang/rust/pull/122553#issuecomment-2007563027, but seems worth to test and land separately, since it is mostly unrelated to that PR.
Diffstat (limited to 'compiler/rustc_middle/src/query')
| -rw-r--r-- | compiler/rustc_middle/src/query/erase.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/query/keys.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/query/erase.rs b/compiler/rustc_middle/src/query/erase.rs index d3da49c26a2..320d49ea646 100644 --- a/compiler/rustc_middle/src/query/erase.rs +++ b/compiler/rustc_middle/src/query/erase.rs @@ -67,6 +67,10 @@ impl<T> EraseType for &'_ ty::List<T> { type Result = [u8; size_of::<&'static ty::List<()>>()]; } +impl<T> EraseType for &'_ ty::ListWithCachedTypeInfo<T> { + type Result = [u8; size_of::<&'static ty::ListWithCachedTypeInfo<()>>()]; +} + impl<I: rustc_index::Idx, T> EraseType for &'_ rustc_index::IndexSlice<I, T> { type Result = [u8; size_of::<&'static rustc_index::IndexSlice<u32, ()>>()]; } diff --git a/compiler/rustc_middle/src/query/keys.rs b/compiler/rustc_middle/src/query/keys.rs index 9cbc4d10146..c1548eb99f5 100644 --- a/compiler/rustc_middle/src/query/keys.rs +++ b/compiler/rustc_middle/src/query/keys.rs @@ -432,7 +432,7 @@ impl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>) { } } -impl<'tcx> Key for &'tcx ty::List<ty::Clause<'tcx>> { +impl<'tcx> Key for ty::Clauses<'tcx> { type Cache<V> = DefaultCache<Self, V>; fn default_span(&self, _: TyCtxt<'_>) -> Span { diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 62a60a650ec..5ef7a20f460 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -398,15 +398,15 @@ rustc_queries! { /// ``` /// /// Bounds from the parent (e.g. with nested impl trait) are not included. - query item_bounds(key: DefId) -> ty::EarlyBinder<&'tcx ty::List<ty::Clause<'tcx>>> { + query item_bounds(key: DefId) -> ty::EarlyBinder<ty::Clauses<'tcx>> { desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) } } - query item_super_predicates(key: DefId) -> ty::EarlyBinder<&'tcx ty::List<ty::Clause<'tcx>>> { + query item_super_predicates(key: DefId) -> ty::EarlyBinder<ty::Clauses<'tcx>> { desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) } } - query item_non_self_assumptions(key: DefId) -> ty::EarlyBinder<&'tcx ty::List<ty::Clause<'tcx>>> { + query item_non_self_assumptions(key: DefId) -> ty::EarlyBinder<ty::Clauses<'tcx>> { desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) } } @@ -2156,7 +2156,7 @@ rustc_queries! { desc { "resolving instance `{}`", ty::Instance::new(key.value.0, key.value.1) } } - query reveal_opaque_types_in_bounds(key: &'tcx ty::List<ty::Clause<'tcx>>) -> &'tcx ty::List<ty::Clause<'tcx>> { + query reveal_opaque_types_in_bounds(key: ty::Clauses<'tcx>) -> ty::Clauses<'tcx> { desc { "revealing opaque types in `{:?}`", key } } |
