File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -511,8 +511,8 @@ macro_rules! int_impl {
511
511
without modifying the original"]
512
512
#[ inline( always) ]
513
513
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
514
- #[ kani :: requires( !self . overflowing_add( rhs) . 1 ) ]
515
- #[ kani :: ensures( |ret| * ret >= $SelfT:: MIN && * ret <= $SelfT:: MAX ) ]
514
+ #[ requires( !self . overflowing_add( rhs) . 1 ) ]
515
+ #[ ensures( |ret| * ret >= $SelfT:: MIN && * ret <= $SelfT:: MAX ) ]
516
516
pub const unsafe fn unchecked_add( self , rhs: Self ) -> Self {
517
517
assert_unsafe_precondition!(
518
518
check_language_ub,
Original file line number Diff line number Diff line change 5
5
use crate :: str:: FromStr ;
6
6
use crate :: ub_checks:: assert_unsafe_precondition;
7
7
use crate :: { ascii, intrinsics, mem} ;
8
+ use safety:: { ensures, requires} ;
9
+
10
+ #[ cfg( kani) ]
11
+ use crate :: kani;
8
12
9
13
// Used because the `?` operator is not allowed in a const context.
10
14
macro_rules! try_opt {
@@ -1585,9 +1589,6 @@ from_str_radix_size_impl! { i32 isize, u32 usize }
1585
1589
#[ cfg( target_pointer_width = "64" ) ]
1586
1590
from_str_radix_size_impl ! { i64 isize , u64 usize }
1587
1591
1588
- #[ cfg( kani) ]
1589
- use crate :: kani;
1590
-
1591
1592
#[ unstable( feature = "kani" , issue = "none" ) ]
1592
1593
mod verify {
1593
1594
use super :: * ;
Original file line number Diff line number Diff line change @@ -558,8 +558,8 @@ macro_rules! uint_impl {
558
558
without modifying the original"]
559
559
#[ inline( always) ]
560
560
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
561
- #[ kani :: requires( !self . overflowing_add( rhs) . 1 ) ]
562
- #[ kani :: ensures( |ret| * ret >= $SelfT:: MIN && * ret <= $SelfT:: MAX ) ]
561
+ #[ requires( !self . overflowing_add( rhs) . 1 ) ]
562
+ #[ ensures( |ret| * ret >= $SelfT:: MIN && * ret <= $SelfT:: MAX ) ]
563
563
pub const unsafe fn unchecked_add( self , rhs: Self ) -> Self {
564
564
assert_unsafe_precondition!(
565
565
check_language_ub,
You can’t perform that action at this time.
0 commit comments