diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 2c20e21f451ab..0fe8e5d0933e9 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -2538,7 +2538,6 @@ ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.rs ui/issues/issue-76077-inaccesible-private-fields/issue-76077.rs ui/issues/issue-76191.rs ui/issues/issue-7660.rs -ui/issues/issue-7663.rs ui/issues/issue-7673-cast-generically-implemented-trait.rs ui/issues/issue-77218/issue-77218-2.rs ui/issues/issue-77218/issue-77218.rs @@ -3634,6 +3633,7 @@ ui/resolve/issue-6702.rs ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs ui/resolve/issue-70736-async-fn-no-body-def-collector.rs ui/resolve/issue-73427.rs +ui/resolve/issue-7663.rs ui/resolve/issue-80079.rs ui/resolve/issue-81508.rs ui/resolve/issue-82156.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 8f9b07c49acbe..d0e225524524f 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1623; +const ISSUES_ENTRY_LIMIT: u32 = 1622; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/ui/issues/issue-14082.rs b/tests/ui/issues/issue-14082.rs index 16556e1d26003..858ee9458084a 100644 --- a/tests/ui/issues/issue-14082.rs +++ b/tests/ui/issues/issue-14082.rs @@ -5,6 +5,7 @@ use foo::Foo; mod foo { + pub use d::*; // this imports d::Foo pub use m::Foo; // this should shadow d::Foo } @@ -16,4 +17,6 @@ mod d { pub struct Foo; } -fn main() {} +fn main() { + let _: foo::Foo = m::Foo; +} diff --git a/tests/ui/issues/issue-7663.rs b/tests/ui/issues/issue-7663.rs deleted file mode 100644 index ad52ea2112704..0000000000000 --- a/tests/ui/issues/issue-7663.rs +++ /dev/null @@ -1,32 +0,0 @@ -//@ run-pass - -#![allow(unused_imports, dead_code)] - -mod test1 { - - mod foo { pub fn p() -> isize { 1 } } - mod bar { pub fn p() -> isize { 2 } } - - pub mod baz { - use test1::bar::p; - - pub fn my_main() { assert_eq!(p(), 2); } - } -} - -mod test2 { - - mod foo { pub fn p() -> isize { 1 } } - mod bar { pub fn p() -> isize { 2 } } - - pub mod baz { - use test2::bar::p; - - pub fn my_main() { assert_eq!(p(), 2); } - } -} - -fn main() { - test1::baz::my_main(); - test2::baz::my_main(); -} diff --git a/tests/ui/resolve/issue-7663.rs b/tests/ui/resolve/issue-7663.rs new file mode 100644 index 0000000000000..25bc294d06f3f --- /dev/null +++ b/tests/ui/resolve/issue-7663.rs @@ -0,0 +1,38 @@ +#![allow(unused_imports, dead_code)] + +mod test1 { + mod foo { + pub struct P; + } + + mod bar { + pub struct P; + } + + pub mod baz { + use test1::foo::*; + use test1::bar::*; + + pub fn f() { + let _ = P; //~ ERROR `P` is ambiguous + } + } +} + +mod test2 { + mod foo { + pub struct P; + } + + mod bar { + pub struct P; + } + + pub mod baz { + use test2::foo::P; + use test2::bar::P; //~ ERROR the name `P` is defined multiple times + } +} + +fn main() { +} diff --git a/tests/ui/resolve/issue-7663.stderr b/tests/ui/resolve/issue-7663.stderr new file mode 100644 index 0000000000000..6f14e04d02828 --- /dev/null +++ b/tests/ui/resolve/issue-7663.stderr @@ -0,0 +1,38 @@ +error[E0252]: the name `P` is defined multiple times + --> $DIR/issue-7663.rs:33:13 + | +LL | use test2::foo::P; + | ------------- previous import of the type `P` here +LL | use test2::bar::P; + | ^^^^^^^^^^^^^ `P` reimported here + | + = note: `P` must be defined only once in the type namespace of this module +help: you can use `as` to change the binding name of the import + | +LL | use test2::bar::P as OtherP; + | +++++++++ + +error[E0659]: `P` is ambiguous + --> $DIR/issue-7663.rs:17:21 + | +LL | let _ = P; + | ^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `P` could refer to the unit struct imported here + --> $DIR/issue-7663.rs:13:13 + | +LL | use test1::foo::*; + | ^^^^^^^^^^^^^ + = help: consider adding an explicit import of `P` to disambiguate +note: `P` could also refer to the unit struct imported here + --> $DIR/issue-7663.rs:14:13 + | +LL | use test1::bar::*; + | ^^^^^^^^^^^^^ + = help: consider adding an explicit import of `P` to disambiguate + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0252, E0659. +For more information about an error, try `rustc --explain E0252`.