diff --git a/src/test/ui/consts/const-eval/issue-85907.rs b/src/test/ui/consts/const-eval/issue-85907.rs new file mode 100644 index 0000000000000..6ae40ae6ddbf6 --- /dev/null +++ b/src/test/ui/consts/const-eval/issue-85907.rs @@ -0,0 +1,7 @@ +const fn hey() -> usize { + panic!(123); //~ ERROR argument to `panic!()` in a const context must have type `&str` +} + +fn main() { + let _: [u8; hey()] = todo!(); +} diff --git a/src/test/ui/consts/const-eval/issue-85907.stderr b/src/test/ui/consts/const-eval/issue-85907.stderr new file mode 100644 index 0000000000000..381f2fd1114ec --- /dev/null +++ b/src/test/ui/consts/const-eval/issue-85907.stderr @@ -0,0 +1,10 @@ +error: argument to `panic!()` in a const context must have type `&str` + --> $DIR/issue-85907.rs:2:5 + | +LL | panic!(123); + | ^^^^^^^^^^^ + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to previous error +