rustc_resolve: fix special-case for one-segment import paths.

This commit is contained in:
Eduard-Mihai Burtescu 2018-08-09 16:29:22 +03:00
parent cd47831bf0
commit f9b1176eef
17 changed files with 433 additions and 238 deletions

View file

@ -101,7 +101,7 @@ impl Path {
// or starts with something like `self`/`super`/`$crate`/etc.
pub fn make_root(&self) -> Option<PathSegment> {
if let Some(ident) = self.segments.get(0).map(|seg| seg.ident) {
if ident.is_path_segment_keyword() && ident.name != keywords::Crate.name() {
if ident.is_path_segment_keyword() {
return None;
}
}