Skip to content
Permalink
Browse files

Update trait_impls_of

  • Loading branch information...
Zoxc committed Nov 30, 2018
1 parent 1fe0d4e commit b164a2da63530d1e5f67415a5654ccb4f9c68099
Showing with 4 additions and 4 deletions.
  1. +1 −0 src/librustc/arena.rs
  2. +1 −1 src/librustc/query/mod.rs
  3. +2 −3 src/librustc/ty/trait_def.rs
@@ -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);
)
}
@@ -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 {}
@@ -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.
@@ -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();

{
@@ -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 {

0 comments on commit b164a2d

Please sign in to comment.
You can’t perform that action at this time.