summaryrefslogtreecommitdiffstats
path: root/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs')
-rw-r--r--tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
new file mode 100644
index 000000000..40c5eacee
--- /dev/null
+++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
@@ -0,0 +1,29 @@
+// edition:2018
+#![feature(decl_macro)]
+
+macro a() {
+ extern crate core as my_core;
+ mod v {
+ // Early resolution.
+ use my_core; //~ ERROR unresolved import `my_core`
+ }
+ mod u {
+ // Late resolution.
+ fn f() { my_core::mem::drop(0); }
+ //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
+ }
+}
+
+a!();
+
+mod v {
+ // Early resolution.
+ use my_core; //~ ERROR unresolved import `my_core`
+}
+mod u {
+ // Late resolution.
+ fn f() { my_core::mem::drop(0); }
+ //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
+}
+
+fn main() {}