rust/tests/ui/consts/issue-66693-panic-in-array-len.stderr
Ralf Jung 17946c22b1 const-eval error: always say in which item the error occurred
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-07 13:42:30 +02:00

16 lines
537 B
Plaintext

error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693-panic-in-array-len.rs:6:20
|
LL | let _ = [0i32; panic!(2f32)];
| ^^^^^^^^^^^^
error[E0080]: evaluation panicked: explicit panic
--> $DIR/issue-66693-panic-in-array-len.rs:10:21
|
LL | let _ = [false; panic!()];
| ^^^^^^^^ evaluation of `main::{constant#1}` failed here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.