hax icon indicating copy to clipboard operation
hax copied to clipboard

Misleading error message on `&mut` function

Open franziskuskiefer opened this issue 7 months ago • 4 comments

The following is expected to fail right now. But the error is a little unexpected with a wrong message.

fn mut_fun(x: &mut u8) -> &mut u8 {
    todo!()
}

Open this code snippet in the playground

error: [HAX0003] (DirectAndMut) The mutation of this &mut is not allowed here.
   --> /nix/store/zwf9ilxjz1kqiphfn0spiwgj63fjyh04-rust-default-1.87.0-nightly-2025-03-29/lib/rustlib/src/rust/library/core/src/macros/mod.rs:890:9
    |
890 |         $crate::panicking::panic("not yet implemented")
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |

franziskuskiefer avatar May 21 '25 05:05 franziskuskiefer

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Jul 24 '25 00:07 github-actions[bot]

This issue has been closed due to a lack of activity since being marked as stale. If you believe this issue is still relevant, please reopen it with an update or comment.

github-actions[bot] avatar Jul 31 '25 00:07 github-actions[bot]

Still relevant

W95Psp avatar Jul 31 '25 07:07 W95Psp

Still relevant. Fits into a greater effort to improve diagnostics and error messages.

clementblaudeau avatar Oct 09 '25 11:10 clementblaudeau