Regression of panic message in const context since 1.89?

Since rust 1.89 the message when the code panic in a const context is no more displayed.

Consider the following code:

fn main() {
    const _: () = assert!(false, "this assert fails");
}

In 1.88:

error[E0080]: evaluation of constant value failed
 --> src\main.rs:2:19
  |
2 |     const _: () = assert!(false, "this assert fails");
  |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation panicked: this assert fails

For more information about this error, try `rustc --explain E0080`.

In 1.89:

error[E0080]: evaluation panicked: this assert fails
 --> src\main.rs:2:19
  |
2 |     const _: () = assert!(false, "this assert fails");
  |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `main::_` failed here

For more information about this error, try `rustc --explain E0080`.

Did I miss this point in the changelog?

It changed from "evaluation of constant value failed" to "evaluation panicked: this assert fails". That seems like an improvement? Not sure why you would call it a regression when it now includes the panic message.

1 Like

My bad :person_facepalming: I didn't read the first line but the evaluation of 'main::_' failed here part.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.