Skip to content

Commit b164a2d

Browse files
committed
Update trait_impls_of
1 parent 1fe0d4e commit b164a2d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc/arena.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ macro_rules! arena_types {
1919
[] region_scope_tree: rustc::middle::region::ScopeTree,
2020
[] item_local_set: rustc::util::nodemap::ItemLocalSet,
2121
[decode] mir_const_qualif: rustc_data_structures::bit_set::BitSet<rustc::mir::Local>,
22+
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
2223
], $tcx);
2324
)
2425
}

src/librustc/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ rustc_queries! {
540540
}
541541

542542
TypeChecking {
543-
query trait_impls_of(key: DefId) -> Lrc<ty::trait_def::TraitImpls> {
543+
query trait_impls_of(key: DefId) -> &'tcx ty::trait_def::TraitImpls {
544544
desc { |tcx| "trait impls of `{}`", tcx.def_path_str(key) }
545545
}
546546
query specialization_graph_of(_: DefId) -> &'tcx specialization_graph::Graph {}

src/librustc/ty/trait_def.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::ty::{Ty, TyCtxt};
1010
use rustc_data_structures::fx::FxHashMap;
1111
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
1212
StableHasherResult};
13-
use rustc_data_structures::sync::Lrc;
1413
use rustc_macros::HashStable;
1514

1615
/// A trait's definition with type information.
@@ -151,7 +150,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
151150
// Query provider for `trait_impls_of`.
152151
pub(super) fn trait_impls_of_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
153152
trait_id: DefId)
154-
-> Lrc<TraitImpls> {
153+
-> &'tcx TraitImpls {
155154
let mut impls = TraitImpls::default();
156155

157156
{
@@ -188,7 +187,7 @@ pub(super) fn trait_impls_of_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
188187
}
189188
}
190189

191-
Lrc::new(impls)
190+
tcx.arena.alloc(impls)
192191
}
193192

194193
impl<'a> HashStable<StableHashingContext<'a>> for TraitImpls {

0 commit comments

Comments
 (0)