Update all_traits
This commit is contained in:
parent
10ef70bb68
commit
5751fcc3b1
@ -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))[..]
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user