Handle glob import in redundancy check
This commit is contained in:
parent
df80eae985
commit
c244c411e4
2 changed files with 4 additions and 10 deletions
|
@ -1294,7 +1294,10 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
|
|||
directive.span,
|
||||
) {
|
||||
Ok(other_binding) => {
|
||||
is_redundant[ns] = Some(binding.def() == other_binding.def());
|
||||
is_redundant[ns] = Some(
|
||||
binding.def() == other_binding.def()
|
||||
&& !other_binding.is_ambiguity()
|
||||
);
|
||||
redundant_span[ns] =
|
||||
Some((other_binding.span, other_binding.is_import()));
|
||||
}
|
||||
|
|
|
@ -25,12 +25,3 @@ LL | use crate::foo::Bar;
|
|||
LL | use crate::foo::Bar;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
warning: the item `S` is imported redundantly
|
||||
--> $DIR/use-redundant.rs:25:9
|
||||
|
|
||||
LL | use m1::*;
|
||||
| ----- the item `S` is already imported here
|
||||
...
|
||||
LL | use m1::S;
|
||||
| ^^^^^
|
||||
|
||||
|
|
Loading…
Reference in a new issue