]> git.lizzy.rs Git - rust.git/commitdiff
resolve: Add a test for issue #57539
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 12 Jan 2019 21:04:47 +0000 (00:04 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 12 Jan 2019 21:15:23 +0000 (00:15 +0300)
src/test/ui/imports/issue-57539.rs [new file with mode: 0644]
src/test/ui/imports/issue-57539.stderr [new file with mode: 0644]

diff --git a/src/test/ui/imports/issue-57539.rs b/src/test/ui/imports/issue-57539.rs
new file mode 100644 (file)
index 0000000..90b74eb
--- /dev/null
@@ -0,0 +1,8 @@
+// edition:2018
+
+mod core {
+    use core; //~ ERROR `core` is ambiguous
+    use crate::*;
+}
+
+fn main() {}
diff --git a/src/test/ui/imports/issue-57539.stderr b/src/test/ui/imports/issue-57539.stderr
new file mode 100644 (file)
index 0000000..3f745fd
--- /dev/null
@@ -0,0 +1,18 @@
+error[E0659]: `core` is ambiguous (name vs any other name during import resolution)
+  --> $DIR/issue-57539.rs:4:9
+   |
+LL |     use core; //~ ERROR `core` is ambiguous
+   |         ^^^^ ambiguous name
+   |
+   = note: `core` could refer to a built-in extern crate
+   = help: use `::core` to refer to this extern crate unambiguously
+note: `core` could also refer to the module imported here
+  --> $DIR/issue-57539.rs:5:9
+   |
+LL |     use crate::*;
+   |         ^^^^^^^^
+   = help: use `self::core` to refer to this module unambiguously
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.