https://gcc.gnu.org/g:076b039b1c0f0dd7f3a53aa3942c7fe5fa3b8f60

commit r17-1083-g076b039b1c0f0dd7f3a53aa3942c7fe5fa3b8f60
Author: Harishankar <[email protected]>
Date:   Wed May 6 19:07:56 2026 +0530

    gccrs: testsuite: Add a testcase for issue 3537
    
    Fixes Rust-GCC/gccrs#3537
    gcc/testsuite/ChangeLog:
            * rust/compile/issue-3537.rs: New test.
    
    Signed-off-by: Harishankar <[email protected]>

Diff:
---
 gcc/testsuite/rust/compile/issue-3537.rs | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gcc/testsuite/rust/compile/issue-3537.rs 
b/gcc/testsuite/rust/compile/issue-3537.rs
new file mode 100644
index 000000000000..59f7495377c1
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-3537.rs
@@ -0,0 +1,18 @@
+#![feature(no_core)]
+#![no_core]
+
+// { dg-error "undeclared lang item: .*into_iter.*" "" { target *-*-* } 0 }
+
+fn main() {
+    'inner: while let Some(0u32) = None {
+    // { dg-error "Cannot find path .None. in this scope" "" { target *-*-* } 
.-1 }
+    // { dg-error "Cannot find path .Some. in this scope" "" { target *-*-* } 
.-2 }
+
+        let _ = Iterator::next(&mut ());
+        // { dg-error "Cannot find path .Iterator::next. in this scope" "" { 
target *-*-* } .-1 }
+
+        let _ = Iterator::next(&mut ());
+        // { dg-error "Cannot find path .Iterator::next. in this scope" "" { 
target *-*-* } .-1 }
+        for _ in false {}
+    }
+}
\ No newline at end of file

Reply via email to