Skip to content

Commit e03b13c

Browse files
Update anonymous-reexport UI test
1 parent 825f088 commit e03b13c

File tree

2 files changed

+26
-39
lines changed

2 files changed

+26
-39
lines changed

tests/ui/lint/anonymous-reexport.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(useless_anonymous_reexport)]
1+
#![deny(unused_imports)]
22
#![crate_type = "rlib"]
33

44
mod my_mod {
@@ -9,13 +9,11 @@ mod my_mod {
99
}
1010

1111
pub use self::my_mod::Foo as _;
12-
pub use self::my_mod::TyFoo as _;
13-
pub use self::my_mod::Bar as _; //~ ERROR
14-
pub use self::my_mod::TyBar as _; //~ ERROR
15-
pub use self::my_mod::{Bar as _}; //~ ERROR
16-
pub use self::my_mod::{Bar as _, Foo as _}; //~ ERROR
17-
pub use self::my_mod::{Bar as _, TyBar as _};
18-
//~^ ERROR
19-
//~| ERROR
12+
pub use self::my_mod::TyFoo as _; //~ ERROR unused import
13+
pub use self::my_mod::Bar as _; //~ ERROR unused import
14+
pub use self::my_mod::TyBar as _; //~ ERROR unused import
15+
pub use self::my_mod::{Bar as _}; //~ ERROR unused import
16+
pub use self::my_mod::{Bar as _, Foo as _}; //~ ERROR unused import
17+
pub use self::my_mod::{Bar as _, TyBar as _}; //~ ERROR unused imports
2018
#[allow(unused_imports)]
2119
use self::my_mod::TyBar as _;
+19-30
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,44 @@
1-
error: useless anonymous re-export
2-
--> $DIR/anonymous-reexport.rs:13:1
1+
error: unused import: `self::my_mod::TyFoo as _`
2+
--> $DIR/anonymous-reexport.rs:12:9
33
|
4-
LL | pub use self::my_mod::Bar as _;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | pub use self::my_mod::TyFoo as _;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: only anonymous re-exports of traits are useful, this is a `struct`
87
note: the lint level is defined here
98
--> $DIR/anonymous-reexport.rs:1:9
109
|
11-
LL | #![deny(useless_anonymous_reexport)]
12-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![deny(unused_imports)]
11+
| ^^^^^^^^^^^^^^
1312

14-
error: useless anonymous re-export
15-
--> $DIR/anonymous-reexport.rs:14:1
13+
error: unused import: `self::my_mod::Bar as _`
14+
--> $DIR/anonymous-reexport.rs:13:9
1615
|
17-
LL | pub use self::my_mod::TyBar as _;
18-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
LL | pub use self::my_mod::Bar as _;
17+
| ^^^^^^^^^^^^^^^^^^^^^^
18+
19+
error: unused import: `self::my_mod::TyBar as _`
20+
--> $DIR/anonymous-reexport.rs:14:9
1921
|
20-
= note: only anonymous re-exports of traits are useful, this is a `type alias`
22+
LL | pub use self::my_mod::TyBar as _;
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^
2124

22-
error: useless anonymous re-export
25+
error: unused import: `Bar as _`
2326
--> $DIR/anonymous-reexport.rs:15:24
2427
|
2528
LL | pub use self::my_mod::{Bar as _};
2629
| ^^^^^^^^
27-
|
28-
= note: only anonymous re-exports of traits are useful, this is a `struct`
2930

30-
error: useless anonymous re-export
31+
error: unused import: `Bar as _`
3132
--> $DIR/anonymous-reexport.rs:16:24
3233
|
3334
LL | pub use self::my_mod::{Bar as _, Foo as _};
3435
| ^^^^^^^^
35-
|
36-
= note: only anonymous re-exports of traits are useful, this is a `struct`
3736

38-
error: useless anonymous re-export
37+
error: unused imports: `Bar as _`, `TyBar as _`
3938
--> $DIR/anonymous-reexport.rs:17:24
4039
|
4140
LL | pub use self::my_mod::{Bar as _, TyBar as _};
42-
| ^^^^^^^^
43-
|
44-
= note: only anonymous re-exports of traits are useful, this is a `struct`
45-
46-
error: useless anonymous re-export
47-
--> $DIR/anonymous-reexport.rs:17:34
48-
|
49-
LL | pub use self::my_mod::{Bar as _, TyBar as _};
50-
| ^^^^^^^^^^
51-
|
52-
= note: only anonymous re-exports of traits are useful, this is a `type alias`
41+
| ^^^^^^^^ ^^^^^^^^^^
5342

5443
error: aborting due to 6 previous errors
5544

0 commit comments

Comments
 (0)