Rollup merge of #125559 - scottmcm:simplify-shift-ubcheck, r=workingj… · model-checking/verify-rust-std@a74509c (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1282,8 +1282,7 @@ macro_rules! int_impl { | ||
1282 | 1282 | concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"), |
1283 | 1283 | ( |
1284 | 1284 | rhs: u32 = rhs, |
1285 | - bits: u32 = Self::BITS, | |
1286 | -) => rhs < bits, | |
1285 | +) => rhs < <$ActualT>::BITS, | |
1287 | 1286 | ); |
1288 | 1287 | |
1289 | 1288 | // SAFETY: this is guaranteed to be safe by the caller. |
@@ -1381,8 +1380,7 @@ macro_rules! int_impl { | ||
1381 | 1380 | concat!(stringify!($SelfT), "::unchecked_shr cannot overflow"), |
1382 | 1381 | ( |
1383 | 1382 | rhs: u32 = rhs, |
1384 | - bits: u32 = Self::BITS, | |
1385 | -) => rhs < bits, | |
1383 | +) => rhs < <$ActualT>::BITS, | |
1386 | 1384 | ); |
1387 | 1385 | |
1388 | 1386 | // SAFETY: this is guaranteed to be safe by the caller. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1369,8 +1369,7 @@ macro_rules! uint_impl { | ||
1369 | 1369 | concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"), |
1370 | 1370 | ( |
1371 | 1371 | rhs: u32 = rhs, |
1372 | - bits: u32 = Self::BITS, | |
1373 | -) => rhs < bits, | |
1372 | +) => rhs < <$ActualT>::BITS, | |
1374 | 1373 | ); |
1375 | 1374 | |
1376 | 1375 | // SAFETY: this is guaranteed to be safe by the caller. |
@@ -1468,8 +1467,7 @@ macro_rules! uint_impl { | ||
1468 | 1467 | concat!(stringify!($SelfT), "::unchecked_shr cannot overflow"), |
1469 | 1468 | ( |
1470 | 1469 | rhs: u32 = rhs, |
1471 | - bits: u32 = Self::BITS, | |
1472 | -) => rhs < bits, | |
1470 | +) => rhs < <$ActualT>::BITS, | |
1473 | 1471 | ); |
1474 | 1472 | |
1475 | 1473 | // SAFETY: this is guaranteed to be safe by the caller. |