Skip to content

Commit 89a23bf

Browse files
committed
add regression test for #85907
1 parent 4334739 commit 89a23bf

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
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+
}
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)