From: Arthur Cohen <[email protected]>

Fixes Rust-GCC/gccrs#2259.

This adds a testcase to make sure a regression isn't introduced later on.

gcc/testsuite/ChangeLog:

        * rust/compile/issues/2259.rs: New test.

Tested on x86_64-pc-linux-gnu.

---
 gcc/testsuite/rust/compile/issues/2259.rs | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/issues/2259.rs

diff --git a/gcc/testsuite/rust/compile/issues/2259.rs 
b/gcc/testsuite/rust/compile/issues/2259.rs
new file mode 100644
index 00000000000..2530b4a24ea
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issues/2259.rs
@@ -0,0 +1,18 @@
+#![feature(no_core)]
+#![no_core]
+
+pub mod foo {
+    pub fn bar() {}
+
+    #[macro_export]
+    macro_rules! qux {
+        () => {};
+    }
+}
+
+// is valid if this is uncommented
+// use foo::*;
+
+fn main() {
+    bar(); // { dg-error "Cannot find path .bar. in this scope" }
+}
-- 
2.55.0

Reply via email to