SIGN IN SIGN UP

Rollup merge of #161204 - tgross35:funnel-shift-panic, r=nia-e

core: Make funnel shifts panic only if overflow checks are enabled

Change from the existing behavior of panicking unconditionally to panicking only if overflow checks are enabled, wrapping otherwise. This is more consistent with other operations, and gives slightly better codegen https://rust.godbolt.org/z/Yz81zhbno.

Suggested in the stabilization PR at https://github.com/rust-lang/rust/pull/161015#issuecomment-5285000069.

The first commit adds some simple tests for overflow behavior that I couldn't find existing anywhere else.
J
Jonathan Brouwer committed
6bb82bd5a3318f0172b08713b757f45cf38caa58
Committed by GitHub <noreply@github.com> on 8/25/2026, 5:05:36 AM