about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-29 22:22:46 +0200
committerGitHub <noreply@github.com>2019-04-29 22:22:46 +0200
commit04942105ef2385fcc000b8ffa1825a870c095ea9 (patch)
tree95dfc009af283f3c210c24bea7212ba772688344 /src
parent4369f0362060ba906e5cfbf19a4e147666cd1f3c (diff)
parent7cafacdd82226e57971fe629311a41b26d68838c (diff)
Rollup merge of #60360 - rasendubi:const-labeled-break, r=Centril
Add test case for labeled break in const assignment

Fixes #51350.
Diffstat (limited to 'src')
-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);
+}