Skip to content

Commit 5751fcc

Browse files
committed
Update all_traits
1 parent 10ef70b commit 5751fcc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ macro_rules! arena_types {
8181
[few] lint_levels: rustc::lint::LintLevelMap,
8282
[few] stability_index: rustc::middle::stability::Index<'tcx>,
8383
[few] features: syntax::feature_gate::Features,
84+
[few] all_traits: Vec<rustc::hir::def_id::DefId>,
8485
], $tcx);
8586
)
8687
}

src/librustc/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ rustc_queries! {
850850
/// A vector of every trait accessible in the whole crate
851851
/// (i.e., including those from subcrates). This is used only for
852852
/// error reporting.
853-
query all_traits(_: CrateNum) -> Lrc<Vec<DefId>> {
853+
query all_traits(_: CrateNum) -> &'tcx [DefId] {
854854
desc { "fetching all foreign and local traits" }
855855
}
856856
}

src/librustc_typeck/check/method/suggest.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::middle::lang_items::FnOnceTraitLangItem;
66
use crate::namespace::Namespace;
77
use crate::util::nodemap::FxHashSet;
88
use errors::{Applicability, DiagnosticBuilder};
9-
use rustc_data_structures::sync::Lrc;
109
use rustc::hir::{self, ExprKind, Node, QPath};
1110
use rustc::hir::def::{Res, DefKind};
1211
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>
844843
pub fn provide(providers: &mut ty::query::Providers<'_>) {
845844
providers.all_traits = |tcx, cnum| {
846845
assert_eq!(cnum, LOCAL_CRATE);
847-
Lrc::new(compute_all_traits(tcx))
846+
&tcx.arena.alloc(compute_all_traits(tcx))[..]
848847
}
849848
}
850849

0 commit comments

Comments
 (0)