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:
parent
c6c6cf9515
commit
b057c554ab
12 changed files with 53 additions and 40 deletions
|
@ -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()?)
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue