Skip to content

Commit

Permalink
Update trait_impls_of
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Apr 25, 2019
1 parent 1fe0d4e commit b164a2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/librustc/arena.rs
Expand Up @@ -19,6 +19,7 @@ macro_rules! arena_types {
[] region_scope_tree: rustc::middle::region::ScopeTree,
[] item_local_set: rustc::util::nodemap::ItemLocalSet,
[decode] mir_const_qualif: rustc_data_structures::bit_set::BitSet<rustc::mir::Local>,
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
], $tcx);
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/query/mod.rs
Expand Up @@ -540,7 +540,7 @@ rustc_queries! {
}

TypeChecking {
query trait_impls_of(key: DefId) -> Lrc<ty::trait_def::TraitImpls> {
query trait_impls_of(key: DefId) -> &'tcx ty::trait_def::TraitImpls {
desc { |tcx| "trait impls of `{}`", tcx.def_path_str(key) }
}
query specialization_graph_of(_: DefId) -> &'tcx specialization_graph::Graph {}
Expand Down
5 changes: 2 additions & 3 deletions src/librustc/ty/trait_def.rs
Expand Up @@ -10,7 +10,6 @@ use crate::ty::{Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
StableHasherResult};
use rustc_data_structures::sync::Lrc;
use rustc_macros::HashStable;

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

{
Expand Down Expand Up @@ -188,7 +187,7 @@ pub(super) fn trait_impls_of_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
}
}

Lrc::new(impls)
tcx.arena.alloc(impls)
}

impl<'a> HashStable<StableHashingContext<'a>> for TraitImpls {
Expand Down

0 comments on commit b164a2d

Please sign in to comment.