mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
Avoid false positive unused import warnings.
This commit is contained in:
@@ -1276,16 +1276,17 @@ fn record_use(&mut self, name: Name, ns: Namespace, binding: &'a NameBinding<'a>
|
||||
self.used_crates.insert(krate);
|
||||
}
|
||||
|
||||
if let NameBindingKind::Import { directive, .. } = binding.kind {
|
||||
self.used_imports.insert((directive.id, ns));
|
||||
self.add_to_glob_map(directive.id, name);
|
||||
}
|
||||
|
||||
if binding.ambiguity().is_some() {
|
||||
self.ambiguity_errors.push((span, name, binding));
|
||||
return true;
|
||||
}
|
||||
|
||||
if let NameBindingKind::Import { directive, binding } = binding.kind {
|
||||
self.used_imports.insert((directive.id, ns));
|
||||
self.add_to_glob_map(directive.id, name);
|
||||
self.record_use(name, ns, binding, span);
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user