about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTaiki Endo <te316e89@gmail.com>2019-03-29 13:54:50 +0900
committerTaiki Endo <te316e89@gmail.com>2019-03-29 13:54:50 +0900
commit362d2439bdd221b0efa4f0d28bb51bfde0ea9484 (patch)
tree416f7d3bc4cee35aeca763a85adc25a9b45b4df6 /src
parentd59b46fd49022c1396e203d942103d3483840adf (diff)
downloadrust-362d2439bdd221b0efa4f0d28bb51bfde0ea9484.tar.gz
rust-362d2439bdd221b0efa4f0d28bb51bfde0ea9484.zip
Fix error in Rust 2018 + no_core environment
Diffstat (limited to 'src')
-rw-r--r--src/librustc_resolve/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index f48cfa0b147..ab3d87fafda 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())