AST: Make renames in imports closer to the source

Fix `unused_import_braces` lint false positive on `use prefix::{self as rename}`
This commit is contained in:
Vadim Petrochenkov 2018-03-09 18:58:44 +03:00
parent c6c6cf9515
commit b057c554ab
12 changed files with 53 additions and 40 deletions

View file

@ -7033,9 +7033,7 @@ impl<'a> Parser<'a> {
}
} else {
// `use path::foo;` or `use path::foo as bar;`
let rename = self.parse_rename()?.
unwrap_or(prefix.segments.last().unwrap().identifier);
UseTreeKind::Simple(rename)
UseTreeKind::Simple(self.parse_rename()?)
}
};