From 5751fcc3b129a31981e9e24ee0ad063b9c7574ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 30 Nov 2018 22:58:06 +0100 Subject: [PATCH] Update all_traits --- src/librustc/arena.rs | 1 + src/librustc/query/mod.rs | 2 +- src/librustc_typeck/check/method/suggest.rs | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/arena.rs b/src/librustc/arena.rs index b9126b619cd..8716f3e22cc 100644 --- a/src/librustc/arena.rs +++ b/src/librustc/arena.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, ], $tcx); ) } diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 759ee41f0e0..9bbc91e4556 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -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> { + query all_traits(_: CrateNum) -> &'tcx [DefId] { desc { "fetching all foreign and local traits" } } } diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 77d2ffab8ef..dfe21edee41 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -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 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))[..] } }