while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet.

This commit is contained in:
Mazdak Farrokhzad 2019-06-20 10:35:27 +02:00
parent 4edfa6d4c9
commit 7d1cd41be3
2 changed files with 11 additions and 3 deletions

View File

@ -4,7 +4,6 @@
// 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() {
println!("{:?}", CRASH);
}
fn main() {}

View File

@ -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`.