Skip to content

Commit

Permalink
Update anonymous-reexport UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 22, 2023
1 parent 825f088 commit e03b13c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 39 deletions.
16 changes: 7 additions & 9 deletions tests/ui/lint/anonymous-reexport.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(useless_anonymous_reexport)]
#![deny(unused_imports)]
#![crate_type = "rlib"]

mod my_mod {
Expand All @@ -9,13 +9,11 @@ mod my_mod {
}

pub use self::my_mod::Foo as _;
pub use self::my_mod::TyFoo as _;
pub use self::my_mod::Bar as _; //~ ERROR
pub use self::my_mod::TyBar as _; //~ ERROR
pub use self::my_mod::{Bar as _}; //~ ERROR
pub use self::my_mod::{Bar as _, Foo as _}; //~ ERROR
pub use self::my_mod::{Bar as _, TyBar as _};
//~^ ERROR
//~| ERROR
pub use self::my_mod::TyFoo as _; //~ ERROR unused import
pub use self::my_mod::Bar as _; //~ ERROR unused import
pub use self::my_mod::TyBar as _; //~ ERROR unused import
pub use self::my_mod::{Bar as _}; //~ ERROR unused import
pub use self::my_mod::{Bar as _, Foo as _}; //~ ERROR unused import
pub use self::my_mod::{Bar as _, TyBar as _}; //~ ERROR unused imports
#[allow(unused_imports)]
use self::my_mod::TyBar as _;
49 changes: 19 additions & 30 deletions tests/ui/lint/anonymous-reexport.stderr
Original file line number Diff line number Diff line change
@@ -1,55 +1,44 @@
error: useless anonymous re-export
--> $DIR/anonymous-reexport.rs:13:1
error: unused import: `self::my_mod::TyFoo as _`
--> $DIR/anonymous-reexport.rs:12:9
|
LL | pub use self::my_mod::Bar as _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | pub use self::my_mod::TyFoo as _;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only anonymous re-exports of traits are useful, this is a `struct`
note: the lint level is defined here
--> $DIR/anonymous-reexport.rs:1:9
|
LL | #![deny(useless_anonymous_reexport)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #![deny(unused_imports)]
| ^^^^^^^^^^^^^^

error: useless anonymous re-export
--> $DIR/anonymous-reexport.rs:14:1
error: unused import: `self::my_mod::Bar as _`
--> $DIR/anonymous-reexport.rs:13:9
|
LL | pub use self::my_mod::TyBar as _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | pub use self::my_mod::Bar as _;
| ^^^^^^^^^^^^^^^^^^^^^^

error: unused import: `self::my_mod::TyBar as _`
--> $DIR/anonymous-reexport.rs:14:9
|
= note: only anonymous re-exports of traits are useful, this is a `type alias`
LL | pub use self::my_mod::TyBar as _;
| ^^^^^^^^^^^^^^^^^^^^^^^^

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

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

error: useless anonymous re-export
error: unused imports: `Bar as _`, `TyBar as _`
--> $DIR/anonymous-reexport.rs:17:24
|
LL | pub use self::my_mod::{Bar as _, TyBar as _};
| ^^^^^^^^
|
= note: only anonymous re-exports of traits are useful, this is a `struct`

error: useless anonymous re-export
--> $DIR/anonymous-reexport.rs:17:34
|
LL | pub use self::my_mod::{Bar as _, TyBar as _};
| ^^^^^^^^^^
|
= note: only anonymous re-exports of traits are useful, this is a `type alias`
| ^^^^^^^^ ^^^^^^^^^^

error: aborting due to 6 previous errors

0 comments on commit e03b13c

Please sign in to comment.