diff options
| author | Taiki Endo <te316e89@gmail.com> | 2019-03-29 13:54:50 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2019-03-29 13:54:50 +0900 |
| commit | 362d2439bdd221b0efa4f0d28bb51bfde0ea9484 (patch) | |
| tree | 416f7d3bc4cee35aeca763a85adc25a9b45b4df6 /src | |
| parent | d59b46fd49022c1396e203d942103d3483840adf (diff) | |
| download | rust-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.rs | 7 |
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()) |
