You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
We don't consistently handle overflows and numeric as-casts robustly #7151
In various places in the codebase, for various stable/unstable options, we are not very careful with how we handle potential underflow/overflows. The typical pattern looks like
Plain a + b or a - b (underflow/overflow potential; panic in debug, wraparound in release)
as-casts between integral numeric types with different ranges; typical pattern looks like a as isize/a as usize. Typically this has potential for bitwise reinterpretation to do funny things.
Activity
jieyouxu commentedon Sep 29, 2026
(NB: you can obviously use clippy restriction lints on bare arithmetic ops, the tradeoff there is that it makes arithmetic ops quite verbose 😆)