We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22c27f8 commit abd9905Copy full SHA for abd9905
1 file changed
libm/src/math/support/big/tests.rs
@@ -269,10 +269,10 @@ fn shr_u256_overflow() {
269
#[test]
270
#[cfg(not(debug_assertions))]
271
fn shr_u256_overflow() {
272
- // No panic without debug assertions
273
- assert_eq!(u256::MAX >> 256, u256::ZERO);
274
- assert_eq!(u256::MAX >> 257, u256::ZERO);
275
- assert_eq!(u256::MAX >> u32::MAX, u256::ZERO);
+ // Without debug assertions, the shift amount is wrapped
+ assert_eq!(u256::MAX >> 256, u256::MAX);
+ assert_eq!(u256::MAX >> 257, u256::MAX >> 1);
+ assert_eq!(u256::MAX >> u32::MAX, u256::ONE);
276
}
277
278
0 commit comments