]> git.lizzy.rs Git - rust.git/commitdiff
while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet.
authorMazdak Farrokhzad <twingoow@gmail.com>
Thu, 20 Jun 2019 08:35:27 +0000 (10:35 +0200)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sat, 6 Jul 2019 04:43:58 +0000 (06:43 +0200)
src/test/run-pass/consts/const-labeled-break.rs [deleted file]
src/test/ui/consts/const-labeled-break.rs [new file with mode: 0644]
src/test/ui/consts/const-labeled-break.stderr [new file with mode: 0644]

diff --git a/src/test/run-pass/consts/const-labeled-break.rs b/src/test/run-pass/consts/const-labeled-break.rs
deleted file mode 100644 (file)
index 9417159..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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);
-}
diff --git a/src/test/ui/consts/const-labeled-break.rs b/src/test/ui/consts/const-labeled-break.rs
new file mode 100644 (file)
index 0000000..512ad94
--- /dev/null
@@ -0,0 +1,9 @@
+// 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 {};
+//~^ ERROR constant contains unimplemented expression type
+
+fn main() {}
diff --git a/src/test/ui/consts/const-labeled-break.stderr b/src/test/ui/consts/const-labeled-break.stderr
new file mode 100644 (file)
index 0000000..2009e92
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0019]: constant contains unimplemented expression type
+  --> $DIR/const-labeled-break.rs:6:19
+   |
+LL | const CRASH: () = 'a: while break 'a {};
+   |                   ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0019`.