Skip to content

Commit efb6489

Browse files
update tests
1 parent 4a2a0dc commit efb6489

File tree

6 files changed

+33
-91
lines changed

6 files changed

+33
-91
lines changed

tests/ui/imports/ambiguous-9.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ pub mod dsl {
44
mod range {
55
pub fn date_range() {}
66
}
7-
pub use self::range::*; //~ WARNING ambiguous glob re-exports
7+
pub use self::range::*;
88
use super::prelude::*;
99
}
1010

1111
pub mod prelude {
1212
mod t {
1313
pub fn date_range() {}
1414
}
15-
pub use self::t::*; //~ WARNING ambiguous glob re-exports
16-
pub use super::dsl::*;
15+
pub use self::t::*;
16+
pub use super::dsl::*; //~ WARNING ambiguous glob re-exports
1717
}
1818

1919
use dsl::*;
@@ -23,6 +23,4 @@ fn main() {
2323
date_range();
2424
//~^ ERROR `date_range` is ambiguous
2525
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
26-
//~| ERROR `date_range` is ambiguous
27-
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2826
}

tests/ui/imports/ambiguous-9.stderr

Lines changed: 17 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
warning: ambiguous glob re-exports
2-
--> $DIR/ambiguous-9.rs:7:13
2+
--> $DIR/ambiguous-9.rs:16:13
33
|
4-
LL | pub use self::range::*;
5-
| ^^^^^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
6-
LL | use super::prelude::*;
7-
| ----------------- but the name `date_range` in the value namespace is also re-exported here
4+
LL | pub use self::t::*;
5+
| ---------- but the name `date_range` in the value namespace is also re-exported here
6+
LL | pub use super::dsl::*;
7+
| ^^^^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
88
|
99
= note: `#[warn(ambiguous_glob_reexports)]` on by default
1010

@@ -18,50 +18,20 @@ LL | date_range();
1818
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
1919
= note: ambiguous because of multiple glob imports of a name in the same module
2020
note: `date_range` could refer to the function imported here
21-
--> $DIR/ambiguous-9.rs:7:13
21+
--> $DIR/ambiguous-9.rs:16:13
2222
|
23-
LL | pub use self::range::*;
24-
| ^^^^^^^^^^^^^^
23+
LL | pub use super::dsl::*;
24+
| ^^^^^^^^^^^^^
2525
= help: consider adding an explicit import of `date_range` to disambiguate
2626
note: `date_range` could also refer to the function imported here
27-
--> $DIR/ambiguous-9.rs:8:9
28-
|
29-
LL | use super::prelude::*;
30-
| ^^^^^^^^^^^^^^^^^
31-
= help: consider adding an explicit import of `date_range` to disambiguate
32-
= note: `#[deny(ambiguous_glob_imports)]` on by default
33-
34-
warning: ambiguous glob re-exports
3527
--> $DIR/ambiguous-9.rs:15:13
3628
|
3729
LL | pub use self::t::*;
38-
| ^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
39-
LL | pub use super::dsl::*;
40-
| ------------- but the name `date_range` in the value namespace is also re-exported here
41-
42-
error: `date_range` is ambiguous
43-
--> $DIR/ambiguous-9.rs:23:5
44-
|
45-
LL | date_range();
46-
| ^^^^^^^^^^ ambiguous name
47-
|
48-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
49-
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
50-
= note: ambiguous because of multiple glob imports of a name in the same module
51-
note: `date_range` could refer to the function imported here
52-
--> $DIR/ambiguous-9.rs:19:5
53-
|
54-
LL | use dsl::*;
55-
| ^^^^^^
56-
= help: consider adding an explicit import of `date_range` to disambiguate
57-
note: `date_range` could also refer to the function imported here
58-
--> $DIR/ambiguous-9.rs:20:5
59-
|
60-
LL | use prelude::*;
61-
| ^^^^^^^^^^
30+
| ^^^^^^^^^^
6231
= help: consider adding an explicit import of `date_range` to disambiguate
32+
= note: `#[deny(ambiguous_glob_imports)]` on by default
6333

64-
error: aborting due to 2 previous errors; 2 warnings emitted
34+
error: aborting due to 1 previous error; 1 warning emitted
6535

6636
Future incompatibility report: Future breakage diagnostic:
6737
error: `date_range` is ambiguous
@@ -74,40 +44,16 @@ LL | date_range();
7444
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
7545
= note: ambiguous because of multiple glob imports of a name in the same module
7646
note: `date_range` could refer to the function imported here
77-
--> $DIR/ambiguous-9.rs:7:13
78-
|
79-
LL | pub use self::range::*;
80-
| ^^^^^^^^^^^^^^
81-
= help: consider adding an explicit import of `date_range` to disambiguate
82-
note: `date_range` could also refer to the function imported here
83-
--> $DIR/ambiguous-9.rs:8:9
84-
|
85-
LL | use super::prelude::*;
86-
| ^^^^^^^^^^^^^^^^^
87-
= help: consider adding an explicit import of `date_range` to disambiguate
88-
= note: `#[deny(ambiguous_glob_imports)]` on by default
89-
90-
Future breakage diagnostic:
91-
error: `date_range` is ambiguous
92-
--> $DIR/ambiguous-9.rs:23:5
93-
|
94-
LL | date_range();
95-
| ^^^^^^^^^^ ambiguous name
96-
|
97-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
98-
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
99-
= note: ambiguous because of multiple glob imports of a name in the same module
100-
note: `date_range` could refer to the function imported here
101-
--> $DIR/ambiguous-9.rs:19:5
47+
--> $DIR/ambiguous-9.rs:16:13
10248
|
103-
LL | use dsl::*;
104-
| ^^^^^^
49+
LL | pub use super::dsl::*;
50+
| ^^^^^^^^^^^^^
10551
= help: consider adding an explicit import of `date_range` to disambiguate
10652
note: `date_range` could also refer to the function imported here
107-
--> $DIR/ambiguous-9.rs:20:5
53+
--> $DIR/ambiguous-9.rs:15:13
10854
|
109-
LL | use prelude::*;
110-
| ^^^^^^^^^^
55+
LL | pub use self::t::*;
56+
| ^^^^^^^^^^
11157
= help: consider adding an explicit import of `date_range` to disambiguate
11258
= note: `#[deny(ambiguous_glob_imports)]` on by default
11359

tests/ui/imports/glob-conflict-cross-crate-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
glob_conflict::f(); //~ ERROR cannot find function `f` in crate `glob_conflict`
77
//^ FIXME: `glob_conflict::f` should raise an
88
// ambiguity error instead of a not found error.
9-
glob_conflict::glob::f(); //~ ERROR cannot find function `f` in module `glob_conflict::glob`
9+
glob_conflict::glob::f();
1010
//^ FIXME: `glob_conflict::glob::f` should raise an
1111
// ambiguity error instead of a not found error.
1212
}

tests/ui/imports/glob-conflict-cross-crate-1.stderr

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ error[E0425]: cannot find function `f` in crate `glob_conflict`
33
|
44
LL | glob_conflict::f();
55
| ^ not found in `glob_conflict`
6-
7-
error[E0425]: cannot find function `f` in module `glob_conflict::glob`
8-
--> $DIR/glob-conflict-cross-crate-1.rs:9:26
96
|
10-
LL | glob_conflict::glob::f();
11-
| ^ not found in `glob_conflict::glob`
7+
help: consider importing this function
8+
|
9+
LL + use glob_conflict::glob::f;
10+
|
11+
help: if you import `f`, refer to it directly
12+
|
13+
LL - glob_conflict::f();
14+
LL + f();
15+
|
1216

13-
error: aborting due to 2 previous errors
17+
error: aborting due to 1 previous error
1418

1519
For more information about this error, try `rustc --explain E0425`.

tests/ui/proc-macro/derive-helper-legacy-spurious.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
extern crate test_macros;
77

88
#[derive(Empty)]
9-
#[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope
9+
#[empty_helper]
1010
struct Foo {}
1111

1212
fn main() {}

tests/ui/proc-macro/derive-helper-legacy-spurious.stderr

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,5 @@ error: cannot find attribute `dummy` in this scope
44
LL | #![dummy]
55
| ^^^^^
66

7-
error: cannot find attribute `empty_helper` in this scope
8-
--> $DIR/derive-helper-legacy-spurious.rs:9:3
9-
|
10-
LL | #[empty_helper]
11-
| ^^^^^^^^^^^^
12-
13-
error: aborting due to 2 previous errors
7+
error: aborting due to 1 previous error
148

0 commit comments

Comments
 (0)