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