Rollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, r=Mark-Simulacrum
Add regression test for #85907 closes #85907
This commit is contained in:
commit
5c7a04553d
7
src/test/ui/consts/const-eval/issue-85907.rs
Normal file
7
src/test/ui/consts/const-eval/issue-85907.rs
Normal file
@ -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!();
|
||||
}
|
10
src/test/ui/consts/const-eval/issue-85907.stderr
Normal file
10
src/test/ui/consts/const-eval/issue-85907.stderr
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user