aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-3969.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-3969.rs')
-rw-r--r--gcc/testsuite/rust/compile/issue-3969.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-3969.rs b/gcc/testsuite/rust/compile/issue-3969.rs
new file mode 100644
index 0000000..9608589
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-3969.rs
@@ -0,0 +1,30 @@
+#[lang = "sized"]
+pub trait Sized {
+ // Empty.
+}
+
+#[lang = "fn_once"]
+pub trait FnOnce<Args> {
+ #[lang = "fn_once_output"]
+ type Output;
+
+ extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+}
+
+fn main() {
+ [(); {
+ while true {
+ // { dg-error ".constexpr. loop iteration count exceeds limit" "" { target *-*-* } .-1 }
+ break 9;
+ // { dg-error "can only .break. with a value inside a .loop. block .E0571." "" { target *-*-* } .-1 }
+ }
+ 51
+ }];
+
+ while true {
+ break (|| {
+ // { dg-error "can only .break. with a value inside a .loop. block .E0571." "" { target *-*-* } .-1 }
+ let while_true = 9;
+ });
+ }
+}