Simplify the unchecked_sh[lr]
ub-checks a bit
This commit is contained in:
parent
48f00110d0
commit
0c84361342
@ -1282,8 +1282,7 @@ pub const fn strict_shl(self, rhs: u32) -> Self {
|
||||
concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"),
|
||||
(
|
||||
rhs: u32 = rhs,
|
||||
bits: u32 = Self::BITS,
|
||||
) => rhs < bits,
|
||||
) => rhs < <$ActualT>::BITS,
|
||||
);
|
||||
|
||||
// SAFETY: this is guaranteed to be safe by the caller.
|
||||
@ -1381,8 +1380,7 @@ pub const fn strict_shr(self, rhs: u32) -> Self {
|
||||
concat!(stringify!($SelfT), "::unchecked_shr cannot overflow"),
|
||||
(
|
||||
rhs: u32 = rhs,
|
||||
bits: u32 = Self::BITS,
|
||||
) => rhs < bits,
|
||||
) => rhs < <$ActualT>::BITS,
|
||||
);
|
||||
|
||||
// SAFETY: this is guaranteed to be safe by the caller.
|
||||
|
@ -1369,8 +1369,7 @@ pub const fn strict_shl(self, rhs: u32) -> Self {
|
||||
concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"),
|
||||
(
|
||||
rhs: u32 = rhs,
|
||||
bits: u32 = Self::BITS,
|
||||
) => rhs < bits,
|
||||
) => rhs < <$ActualT>::BITS,
|
||||
);
|
||||
|
||||
// SAFETY: this is guaranteed to be safe by the caller.
|
||||
@ -1468,8 +1467,7 @@ pub const fn strict_shr(self, rhs: u32) -> Self {
|
||||
concat!(stringify!($SelfT), "::unchecked_shr cannot overflow"),
|
||||
(
|
||||
rhs: u32 = rhs,
|
||||
bits: u32 = Self::BITS,
|
||||
) => rhs < bits,
|
||||
) => rhs < <$ActualT>::BITS,
|
||||
);
|
||||
|
||||
// SAFETY: this is guaranteed to be safe by the caller.
|
||||
|
@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
bb1: {
|
||||
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4, const core::num::<impl u16>::BITS) -> [return: bb2, unwind unreachable];
|
||||
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable];
|
||||
+ }
|
||||
+
|
||||
+ bb2: {
|
||||
|
@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
bb1: {
|
||||
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4, const core::num::<impl u16>::BITS) -> [return: bb2, unwind unreachable];
|
||||
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable];
|
||||
+ }
|
||||
+
|
||||
+ bb2: {
|
||||
|
@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
bb1: {
|
||||
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4, const core::num::<impl i64>::BITS) -> [return: bb2, unwind unreachable];
|
||||
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable];
|
||||
+ }
|
||||
+
|
||||
+ bb2: {
|
||||
|
@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
bb1: {
|
||||
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4, const core::num::<impl i64>::BITS) -> [return: bb2, unwind unreachable];
|
||||
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable];
|
||||
+ }
|
||||
+
|
||||
+ bb2: {
|
||||
|
Loading…
Reference in New Issue
Block a user