From: Pierre-Emmanuel Patry <[email protected]>
Top level module should collide with extern crate names and the error
should be reported on the module, not the extern crate because the latter
may not have a source location given it may have been injected.
gcc/testsuite/ChangeLog:
* rust/minicore/top_core_modules.rs: New test.
* rust/minicore/top_core_modules_core/lib.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Tested on x86_64-pc-linux-gnu.
---
gcc/testsuite/rust/minicore/top_core_modules.rs | 4 ++++
gcc/testsuite/rust/minicore/top_core_modules_core/lib.rs | 4 ++++
2 files changed, 8 insertions(+)
create mode 100644 gcc/testsuite/rust/minicore/top_core_modules.rs
create mode 100644 gcc/testsuite/rust/minicore/top_core_modules_core/lib.rs
diff --git a/gcc/testsuite/rust/minicore/top_core_modules.rs
b/gcc/testsuite/rust/minicore/top_core_modules.rs
new file mode 100644
index 00000000000..380ef314b57
--- /dev/null
+++ b/gcc/testsuite/rust/minicore/top_core_modules.rs
@@ -0,0 +1,4 @@
+#![feature(no_std)]
+#![no_std]
+
+mod core {} // { dg-error ".core. defined multiple times" }
diff --git a/gcc/testsuite/rust/minicore/top_core_modules_core/lib.rs
b/gcc/testsuite/rust/minicore/top_core_modules_core/lib.rs
new file mode 100644
index 00000000000..210881f5964
--- /dev/null
+++ b/gcc/testsuite/rust/minicore/top_core_modules_core/lib.rs
@@ -0,0 +1,4 @@
+#![feature(no_core)]
+#![no_core]
+
+pub struct Titi;
--
2.55.0