Skip to content

Commit 57d2254

Browse files
committed
Fix test for #7663
Fixes #140780
1 parent a350eb3 commit 57d2254

File tree

5 files changed

+78
-34
lines changed

5 files changed

+78
-34
lines changed

src/tools/tidy/src/issues.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2538,7 +2538,6 @@ ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.rs
25382538
ui/issues/issue-76077-inaccesible-private-fields/issue-76077.rs
25392539
ui/issues/issue-76191.rs
25402540
ui/issues/issue-7660.rs
2541-
ui/issues/issue-7663.rs
25422541
ui/issues/issue-7673-cast-generically-implemented-trait.rs
25432542
ui/issues/issue-77218/issue-77218-2.rs
25442543
ui/issues/issue-77218/issue-77218.rs
@@ -3634,6 +3633,7 @@ ui/resolve/issue-6702.rs
36343633
ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs
36353634
ui/resolve/issue-70736-async-fn-no-body-def-collector.rs
36363635
ui/resolve/issue-73427.rs
3636+
ui/resolve/issue-7663.rs
36373637
ui/resolve/issue-80079.rs
36383638
ui/resolve/issue-81508.rs
36393639
ui/resolve/issue-82156.rs

src/tools/tidy/src/ui_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ignore::Walk;
1717
const ENTRY_LIMIT: u32 = 901;
1818
// FIXME: The following limits should be reduced eventually.
1919

20-
const ISSUES_ENTRY_LIMIT: u32 = 1623;
20+
const ISSUES_ENTRY_LIMIT: u32 = 1622;
2121

2222
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2323
"rs", // test source files

tests/ui/issues/issue-7663.rs

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/ui/resolve/issue-7663.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#![allow(unused_imports, dead_code)]
2+
3+
mod test1 {
4+
mod foo {
5+
pub struct P;
6+
}
7+
8+
mod bar {
9+
pub struct P;
10+
}
11+
12+
pub mod baz {
13+
use test1::foo::*;
14+
use test1::bar::*;
15+
16+
pub fn f() {
17+
let _ = P; //~ ERROR `P` is ambiguous
18+
}
19+
}
20+
}
21+
22+
mod test2 {
23+
mod foo {
24+
pub struct P;
25+
}
26+
27+
mod bar {
28+
pub struct P;
29+
}
30+
31+
pub mod baz {
32+
use test2::foo::P;
33+
use test2::bar::P; //~ ERROR the name `P` is defined multiple times
34+
}
35+
}
36+
37+
fn main() {
38+
}

tests/ui/resolve/issue-7663.stderr

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
error[E0252]: the name `P` is defined multiple times
2+
--> $DIR/issue-7663.rs:33:13
3+
|
4+
LL | use test2::foo::P;
5+
| ------------- previous import of the type `P` here
6+
LL | use test2::bar::P;
7+
| ^^^^^^^^^^^^^ `P` reimported here
8+
|
9+
= note: `P` must be defined only once in the type namespace of this module
10+
help: you can use `as` to change the binding name of the import
11+
|
12+
LL | use test2::bar::P as OtherP;
13+
| +++++++++
14+
15+
error[E0659]: `P` is ambiguous
16+
--> $DIR/issue-7663.rs:17:21
17+
|
18+
LL | let _ = P;
19+
| ^ ambiguous name
20+
|
21+
= note: ambiguous because of multiple glob imports of a name in the same module
22+
note: `P` could refer to the unit struct imported here
23+
--> $DIR/issue-7663.rs:13:13
24+
|
25+
LL | use test1::foo::*;
26+
| ^^^^^^^^^^^^^
27+
= help: consider adding an explicit import of `P` to disambiguate
28+
note: `P` could also refer to the unit struct imported here
29+
--> $DIR/issue-7663.rs:14:13
30+
|
31+
LL | use test1::bar::*;
32+
| ^^^^^^^^^^^^^
33+
= help: consider adding an explicit import of `P` to disambiguate
34+
35+
error: aborting due to 2 previous errors
36+
37+
Some errors have detailed explanations: E0252, E0659.
38+
For more information about an error, try `rustc --explain E0252`.

0 commit comments

Comments
 (0)