[COMMITTED 12/19] gccrs: testsuite: Add a testcase for issue 3537
arthur.cohen@embecosm.com
arthur.cohen@embecosm.com
Mon Jun 1 13:40:50 GMT 2026
From: Harishankar <harishankarpp7@gmail.com>
Fixes Rust-GCC/gccrs#3537
gcc/testsuite/ChangeLog:
* rust/compile/issue-3537.rs: New test.
Signed-off-by: Harishankar <harishankarpp7@gmail.com>
---
gcc/testsuite/rust/compile/issue-3537.rs | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/issue-3537.rs
diff --git a/gcc/testsuite/rust/compile/issue-3537.rs b/gcc/testsuite/rust/compile/issue-3537.rs
new file mode 100644
index 00000000000..59f7495377c
--- /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
--
2.50.1
More information about the Gcc-rust
mailing list