store the span of the nested part of the use tree in the ast
This commit is contained in:
parent
2ec337c193
commit
13f76235b3
17 changed files with 45 additions and 36 deletions
|
@ -1499,7 +1499,7 @@ declare_lint_pass!(UnusedImportBraces => [UNUSED_IMPORT_BRACES]);
|
|||
|
||||
impl UnusedImportBraces {
|
||||
fn check_use_tree(&self, cx: &EarlyContext<'_>, use_tree: &ast::UseTree, item: &ast::Item) {
|
||||
if let ast::UseTreeKind::Nested(ref items) = use_tree.kind {
|
||||
if let ast::UseTreeKind::Nested { ref items, .. } = use_tree.kind {
|
||||
// Recursively check nested UseTrees
|
||||
for (tree, _) in items {
|
||||
self.check_use_tree(cx, tree, item);
|
||||
|
@ -1520,7 +1520,7 @@ impl UnusedImportBraces {
|
|||
rename.unwrap_or(orig_ident).name
|
||||
}
|
||||
ast::UseTreeKind::Glob => Symbol::intern("*"),
|
||||
ast::UseTreeKind::Nested(_) => return,
|
||||
ast::UseTreeKind::Nested { .. } => return,
|
||||
};
|
||||
|
||||
cx.emit_span_lint(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue