about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2019-04-28 23:12:35 +0300
committerAlexey Shmalko <rasen.dubi@gmail.com>2019-04-28 23:12:35 +0300
commit7cafacdd82226e57971fe629311a41b26d68838c (patch)
tree2cf7c1671babed67ddec2ece386cfa76e5b5714d
parent012c300706a1d73b39f6de6f71ba8c1ae5f958e8 (diff)
downloadrust-7cafacdd82226e57971fe629311a41b26d68838c.tar.gz
rust-7cafacdd82226e57971fe629311a41b26d68838c.zip
Add test case for labeled break in const assignment
See https://github.com/rust-lang/rust/issues/51350 for more information.
-rw-r--r--src/test/run-pass/consts/const-labeled-break.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/run-pass/consts/const-labeled-break.rs b/src/test/run-pass/consts/const-labeled-break.rs
new file mode 100644
index 00000000000..9417159e6fb
--- /dev/null
+++ b/src/test/run-pass/consts/const-labeled-break.rs
@@ -0,0 +1,10 @@
+// Using labeled break in a while loop has caused an illegal instruction being
+// generated, and an ICE later.
+//
+// See https://github.com/rust-lang/rust/issues/51350 for more information.
+
+const CRASH: () = 'a: while break 'a {};
+
+fn main() {
+    println!("{:?}", CRASH);
+}