1
Fork 0

Fix error in Rust 2018 + no_core environment

This commit is contained in:
Taiki Endo 2019-03-29 13:54:50 +09:00
parent d59b46fd49
commit 362d2439bd

View file

@ -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())