File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 9
9
10
10
#![ feature( const_fn, integer_atomics, staged_api, stdsimd) ]
11
11
#![ feature( doc_cfg, allow_internal_unstable) ]
12
+ #![ feature( promotable_const_fn, custom_attributes) ]
12
13
#![ cfg_attr( feature = "cargo-clippy" , allow( shadow_reuse) ) ]
13
14
#![ cfg_attr( target_os = "linux" , feature( linkage) ) ]
14
15
#![ no_std]
Original file line number Diff line number Diff line change @@ -12,11 +12,13 @@ use core::sync::atomic::AtomicU64;
12
12
use core:: sync:: atomic:: AtomicU32 ;
13
13
14
14
/// Sets the `bit` of `x`.
15
+ #[ promotable_const_fn]
15
16
pub const fn set_bit ( x : u64 , bit : u32 ) -> u64 {
16
17
x | 1 << bit
17
18
}
18
19
19
20
/// Tests the `bit` of `x`.
21
+ #[ promotable_const_fn]
20
22
pub const fn test_bit ( x : u64 , bit : u32 ) -> bool {
21
23
x & ( 1 << bit) != 0
22
24
}
You can’t perform that action at this time.
0 commit comments