Open
Description
I tried the following code:
const fn overflow() -> u32 {
0 - 1
}
pub const X: u32 = overflow();
fn main() {}
On stable, in release mode, the emits a lint (err-by-default) about the arithmetic overflow. On nightly, it does not.
This probably is related to #78407. However, the part I do not understand is that I can only reproduce the problem with a binary crate, not with a library crate. Cc @oli-obk