Skip to content

Commit 2146a74

Browse files
eduardosmAmanieu
authored andcommitted
Change x <= y - 1 to x < y in static_assert_{u,s}imm_bits
1 parent 0043453 commit 2146a74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/core_arch/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ macro_rules! static_assert_uimm_bits {
2121
#[allow(unused_comparisons)]
2222
{
2323
static_assert!(
24-
0 <= $imm && $imm <= (1 << $bits) - 1,
24+
0 <= $imm && $imm < (1 << $bits),
2525
concat!(
2626
stringify!($imm),
2727
" doesn't fit in ",
@@ -37,7 +37,7 @@ macro_rules! static_assert_uimm_bits {
3737
macro_rules! static_assert_simm_bits {
3838
($imm:ident, $bits:expr) => {
3939
static_assert!(
40-
(-1 << ($bits - 1)) - 1 <= $imm && $imm <= (1 << ($bits - 1)) - 1,
40+
(-1 << ($bits - 1)) - 1 <= $imm && $imm < (1 << ($bits - 1)),
4141
concat!(
4242
stringify!($imm),
4343
" doesn't fit in ",

0 commit comments

Comments
 (0)