diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 7cfd5b5f861a4..fc9a829423868 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1366,7 +1366,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { &single_import.parent_scope, None, ignore_decl, - ignore_import, + None, ) { Err(Determined) => continue, Ok(binding) diff --git a/tests/ui/imports/inconsistent-resolution-153842.rs b/tests/ui/imports/inconsistent-resolution-153842.rs new file mode 100644 index 0000000000000..85fff361e31d8 --- /dev/null +++ b/tests/ui/imports/inconsistent-resolution-153842.rs @@ -0,0 +1,17 @@ +mod a { + pub use crate::s::Trait as s; + //~^ ERROR cannot determine resolution for the import + //~| ERROR cannot determine resolution for the import + //~| ERROR unresolved imports `crate::s::Trait`, `a::s` +} + +mod b { + pub mod s { + pub trait Trait {} + } +} + +use a::s; +use b::*; + +fn main() {} diff --git a/tests/ui/imports/inconsistent-resolution-153842.stderr b/tests/ui/imports/inconsistent-resolution-153842.stderr new file mode 100644 index 0000000000000..2b686ff3f76e0 --- /dev/null +++ b/tests/ui/imports/inconsistent-resolution-153842.stderr @@ -0,0 +1,26 @@ +error: cannot determine resolution for the import + --> $DIR/inconsistent-resolution-153842.rs:2:13 + | +LL | pub use crate::s::Trait as s; + | ^^^^^^^^^^^^^^^^^^^^ + +error: cannot determine resolution for the import + --> $DIR/inconsistent-resolution-153842.rs:2:13 + | +LL | pub use crate::s::Trait as s; + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0432]: unresolved imports `crate::s::Trait`, `a::s` + --> $DIR/inconsistent-resolution-153842.rs:2:13 + | +LL | pub use crate::s::Trait as s; + | ^^^^^^^^^^^^^^^^^^^^ +... +LL | use a::s; + | ^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0432`.