https://gcc.gnu.org/g:8a3b270bc7ca97a973e9e00da292d5750df2b7f8

commit r17-5699-g8a3b270bc7ca97a973e9e00da292d5750df2b7f8
Author: Pierre-Emmanuel Patry <[email protected]>
Date:   Tue Sep 29 12:36:49 2026 +0200

    gccrs: Add test to highlight top core module collision
    
    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]>

Diff:
---
 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(+)

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 000000000000..380ef314b578
--- /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 000000000000..210881f59642
--- /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;

Reply via email to