Update anonymous-reexport UI test

This commit is contained in:
Guillaume Gomez 2023-03-22 15:39:16 +01:00
parent 825f0888cc
commit e03b13ccb7
2 changed files with 26 additions and 39 deletions

View File

@ -1,4 +1,4 @@
#![deny(useless_anonymous_reexport)]
#![deny(unused_imports)]
#![crate_type = "rlib"]
mod my_mod {
@ -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 _;

View File

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