summaryrefslogtreecommitdiffstats
path: root/src/test/ui/underscore-imports/shadow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/underscore-imports/shadow.rs')
-rw-r--r--src/test/ui/underscore-imports/shadow.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/underscore-imports/shadow.rs b/src/test/ui/underscore-imports/shadow.rs
new file mode 100644
index 000000000..325f2001b
--- /dev/null
+++ b/src/test/ui/underscore-imports/shadow.rs
@@ -0,0 +1,23 @@
+// Check that underscore imports don't cause glob imports to be unshadowed
+
+mod a {
+ pub use std::ops::Deref as Shadow;
+}
+
+mod b {
+ pub use crate::a::*;
+ macro_rules! m {
+ ($i:ident) => { pub struct $i; }
+ }
+ m!(Shadow);
+}
+
+mod c {
+ use crate::b::Shadow as _; // Only imports the struct
+
+ fn f(x: &()) {
+ x.deref(); //~ ERROR no method named `deref` found
+ }
+}
+
+fn main() {}