Handle glob import in redundancy check

This commit is contained in:
Fabian Drinck 2019-03-18 17:50:49 +01:00
parent df80eae985
commit c244c411e4
2 changed files with 4 additions and 10 deletions

View file

@ -1294,7 +1294,10 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
directive.span, directive.span,
) { ) {
Ok(other_binding) => { 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] = redundant_span[ns] =
Some((other_binding.span, other_binding.is_import())); Some((other_binding.span, other_binding.is_import()));
} }

View file

@ -25,12 +25,3 @@ LL | use crate::foo::Bar;
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;
| ^^^^^