From 362d2439bdd221b0efa4f0d28bb51bfde0ea9484 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 29 Mar 2019 13:54:50 +0900 Subject: [PATCH] Fix error in Rust 2018 + no_core environment --- src/librustc_resolve/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index f48cfa0b1479f..ab3d87fafdac7 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -1697,7 +1697,12 @@ impl<'a> hir::lowering::Resolver for Resolver<'a> { components: &[&str], is_value: bool ) -> hir::Path { - let segments = iter::once(keywords::PathRoot.ident()) + let root = if crate_root.is_some() { + keywords::PathRoot + } else { + keywords::Crate + }; + let segments = iter::once(root.ident()) .chain( crate_root.into_iter() .chain(components.iter().cloned())