Skip to content

Commit

Permalink
Rollup merge of rust-lang#98560 - TaKO8Ki:add-regression-test-for-859…
Browse files Browse the repository at this point in the history
…07, r=Mark-Simulacrum

Add regression test for rust-lang#85907

closes rust-lang#85907
  • Loading branch information
Dylan-DPC authored Jun 28, 2022
2 parents cb39d87 + 89a23bf commit 9e5c7ec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/ui/consts/const-eval/issue-85907.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions src/test/ui/consts/const-eval/issue-85907.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9e5c7ec

Please sign in to comment.