Skip to content

Commit d99844d

Browse files
author
yew005
committed
Remove ensures contracts && Undo formatting on existing code
1 parent ce35002 commit d99844d

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

library/core/src/num/int_macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ macro_rules! int_impl {
512512
#[inline(always)]
513513
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
514514
#[requires(!self.overflowing_add(rhs).1)]
515-
#[ensures(|ret| *ret >= $SelfT::MIN && *ret <= $SelfT::MAX)]
516515
pub const unsafe fn unchecked_add(self, rhs: Self) -> Self {
517516
assert_unsafe_precondition!(
518517
check_language_ub,

library/core/src/num/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,7 @@ const fn from_str_radix_panic_ct(_radix: u32) -> ! {
14011401

14021402
#[track_caller]
14031403
fn from_str_radix_panic_rt(radix: u32) -> ! {
1404-
panic!(
1405-
"from_str_radix_int: must lie in the range `[2, 36]` - found {}",
1406-
radix
1407-
);
1404+
panic!("from_str_radix_int: must lie in the range `[2, 36]` - found {}", radix);
14081405
}
14091406

14101407
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]

library/core/src/num/uint_macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,6 @@ macro_rules! uint_impl {
559559
#[inline(always)]
560560
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
561561
#[requires(!self.overflowing_add(rhs).1)]
562-
#[ensures(|ret| *ret >= $SelfT::MIN && *ret <= $SelfT::MAX)]
563562
pub const unsafe fn unchecked_add(self, rhs: Self) -> Self {
564563
assert_unsafe_precondition!(
565564
check_language_ub,

0 commit comments

Comments
 (0)