summaryrefslogtreecommitdiffstats
path: root/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs')
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
new file mode 100644
index 000000000..828ee4fe4
--- /dev/null
+++ b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
@@ -0,0 +1,21 @@
+// edition:2018
+
+#![allow(non_camel_case_types)]
+
+enum Foo {}
+
+struct std;
+
+fn main() {
+ enum Foo { A, B }
+ use Foo::*;
+ //~^ ERROR `Foo` is ambiguous
+
+ let _ = (A, B);
+
+ fn std() {}
+ enum std {}
+ use std as foo;
+ //~^ ERROR `std` is ambiguous
+ //~| ERROR `std` is ambiguous
+}