From b1398a0de67ce647f490c04a69cab0f76c649f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 30 Nov 2018 22:32:16 +0100 Subject: [PATCH] Update item_children --- src/librustc/query/mod.rs | 2 +- src/librustc_metadata/cstore_impl.rs | 4 ++-- src/librustdoc/clean/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 8920952f00d..4514121da91 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -784,7 +784,7 @@ rustc_queries! { eval_always desc { "fetching what a crate is named" } } - query item_children(_: DefId) -> Lrc>> {} + query item_children(_: DefId) -> &'tcx [Export] {} query extern_mod_stmt_cnum(_: DefId) -> Option {} query get_lib_features(_: CrateNum) -> Lrc { diff --git a/src/librustc_metadata/cstore_impl.rs b/src/librustc_metadata/cstore_impl.rs index 6b06a0712e1..aea2c816b6a 100644 --- a/src/librustc_metadata/cstore_impl.rs +++ b/src/librustc_metadata/cstore_impl.rs @@ -223,9 +223,9 @@ provide! { <'tcx> tcx, def_id, other, cdata, } crate_name => { cdata.name } item_children => { - let mut result = vec![]; + let mut result = SmallVec::<[_; 8]>::new(); cdata.each_child_of_item(def_id.index, |child| result.push(child), tcx.sess); - Lrc::new(result) + tcx.arena.alloc_slice(&result) } defined_lib_features => { Lrc::new(cdata.get_lib_features()) } defined_lang_items => { Lrc::new(cdata.get_lang_items()) } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 1bbbe581c3c..9d4b55526d0 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -4434,7 +4434,7 @@ pub fn path_to_def(tcx: TyCtxt<'_, '_, '_>, path: &[Symbol]) -> Option { loop { let segment = path_it.next()?; - for item in mem::replace(&mut items, Lrc::new(vec![])).iter() { + for item in mem::replace(&mut items, &[]).iter() { if item.ident.name == *segment { if path_it.peek().is_none() { return match item.res {