Skip to content

Commit 5c7a045

Browse files
authored
Rollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, r=Mark-Simulacrum
Add regression test for #85907 closes #85907
2 parents 3991e73 + 89a23bf commit 5c7a045

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Diff for: src/test/ui/consts/const-eval/issue-85907.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const fn hey() -> usize {
2+
panic!(123); //~ ERROR argument to `panic!()` in a const context must have type `&str`
3+
}
4+
5+
fn main() {
6+
let _: [u8; hey()] = todo!();
7+
}

Diff for: src/test/ui/consts/const-eval/issue-85907.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: argument to `panic!()` in a const context must have type `&str`
2+
--> $DIR/issue-85907.rs:2:5
3+
|
4+
LL | panic!(123);
5+
| ^^^^^^^^^^^
6+
|
7+
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)