Skip to content
Permalink
Browse files

Update all_traits

  • Loading branch information...
Zoxc committed Nov 30, 2018
1 parent 10ef70b commit 5751fcc3b129a31981e9e24ee0ad063b9c7574ff
Showing with 3 additions and 3 deletions.
  1. +1 −0 src/librustc/arena.rs
  2. +1 −1 src/librustc/query/mod.rs
  3. +1 −2 src/librustc_typeck/check/method/suggest.rs
@@ -81,6 +81,7 @@ macro_rules! arena_types {
[few] lint_levels: rustc::lint::LintLevelMap,
[few] stability_index: rustc::middle::stability::Index<'tcx>,
[few] features: syntax::feature_gate::Features,
[few] all_traits: Vec<rustc::hir::def_id::DefId>,
], $tcx);
)
}
@@ -850,7 +850,7 @@ rustc_queries! {
/// A vector of every trait accessible in the whole crate
/// (i.e., including those from subcrates). This is used only for
/// error reporting.
query all_traits(_: CrateNum) -> Lrc<Vec<DefId>> {
query all_traits(_: CrateNum) -> &'tcx [DefId] {
desc { "fetching all foreign and local traits" }
}
}
@@ -6,7 +6,6 @@ use crate::middle::lang_items::FnOnceTraitLangItem;
use crate::namespace::Namespace;
use crate::util::nodemap::FxHashSet;
use errors::{Applicability, DiagnosticBuilder};
use rustc_data_structures::sync::Lrc;
use rustc::hir::{self, ExprKind, Node, QPath};
use rustc::hir::def::{Res, DefKind};
use rustc::hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE, DefId};
@@ -844,7 +843,7 @@ fn compute_all_traits<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Vec<DefId>
pub fn provide(providers: &mut ty::query::Providers<'_>) {
providers.all_traits = |tcx, cnum| {
assert_eq!(cnum, LOCAL_CRATE);
Lrc::new(compute_all_traits(tcx))
&tcx.arena.alloc(compute_all_traits(tcx))[..]
}
}

0 comments on commit 5751fcc

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