-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for useless_anonymous_reexport lint
- Loading branch information
1 parent
2df7770
commit ac4ea52
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![deny(useless_anonymous_reexport)] | ||
#![crate_type = "rlib"] | ||
|
||
mod my_mod { | ||
pub trait Foo {} | ||
pub type TyFoo = dyn Foo; | ||
pub struct Bar; | ||
pub type TyBar = Bar; | ||
} | ||
|
||
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 | ||
#[allow(unused_imports)] | ||
use self::my_mod::TyBar as _; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: useless anonymous re-export | ||
--> $DIR/anonymous-reexport.rs:13:1 | ||
| | ||
LL | pub use self::my_mod::Bar as _; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/anonymous-reexport.rs:1:9 | ||
| | ||
LL | #![deny(useless_anonymous_reexport)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: useless anonymous re-export | ||
--> $DIR/anonymous-reexport.rs:14:1 | ||
| | ||
LL | pub use self::my_mod::TyBar as _; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|