Skip to content

Commit b69b2a9

Browse files
committed
Update trait_impls_of
1 parent 6cd2d1a commit b69b2a9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ macro_rules! arena_types {
2121
[] item_local_set: rustc::util::nodemap::ItemLocalSet,
2222
[decode] mir_const_qualif: rustc_data_structures::bit_set::BitSet<rustc::mir::Local>,
2323
[decode] borrowck: rustc::middle::borrowck::BorrowCheckResult,
24+
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
2425
], $tcx);
2526
)
2627
}

src/librustc/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ rustc_queries! {
535535
}
536536

537537
TypeChecking {
538-
query trait_impls_of(key: DefId) -> Lrc<ty::trait_def::TraitImpls> {
538+
query trait_impls_of(key: DefId) -> &'tcx ty::trait_def::TraitImpls {
539539
desc { |tcx| "trait impls of `{}`", tcx.def_path_str(key) }
540540
}
541541
query specialization_graph_of(_: DefId) -> &'tcx specialization_graph::Graph {}

src/librustc/ty/trait_def.rs

Lines changed: 2 additions & 3 deletions
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)