From 7d1cd41be3ac5f9a0fd8a3d4c0a97f0f7c3c277e Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad <twingoow@gmail.com> Date: Thu, 20 Jun 2019 10:35:27 +0200 Subject: [PATCH] while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet. --- src/test/{run-pass => ui}/consts/const-labeled-break.rs | 5 ++--- src/test/ui/consts/const-labeled-break.stderr | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) rename src/test/{run-pass => ui}/consts/const-labeled-break.rs (76%) create mode 100644 src/test/ui/consts/const-labeled-break.stderr diff --git a/src/test/run-pass/consts/const-labeled-break.rs b/src/test/ui/consts/const-labeled-break.rs similarity index 76% rename from src/test/run-pass/consts/const-labeled-break.rs rename to src/test/ui/consts/const-labeled-break.rs index 9417159e6fb..512ad9427ea 100644 --- a/src/test/run-pass/consts/const-labeled-break.rs +++ b/src/test/ui/consts/const-labeled-break.rs @@ -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() {} diff --git a/src/test/ui/consts/const-labeled-break.stderr b/src/test/ui/consts/const-labeled-break.stderr new file mode 100644 index 00000000000..2009e922355 --- /dev/null +++ b/src/test/ui/consts/const-labeled-break.stderr @@ -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`.