summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/anonymous-reexport.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/lint/anonymous-reexport.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/lint/anonymous-reexport.rs b/tests/ui/lint/anonymous-reexport.rs
new file mode 100644
index 000000000..11ac5d071
--- /dev/null
+++ b/tests/ui/lint/anonymous-reexport.rs
@@ -0,0 +1,19 @@
+#![deny(unused_imports)]
+#![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 _; //~ 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 _;