Skip to content

Commit c774e38

Browse files
committed
Mark appropriate const fns as promotable
1 parent a19ca1c commit c774e38

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

crates/stdsimd/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
1010
#![feature(const_fn, integer_atomics, staged_api, stdsimd)]
1111
#![feature(doc_cfg, allow_internal_unstable)]
12+
#![feature(promotable_const_fn, custom_attributes)]
1213
#![cfg_attr(feature = "cargo-clippy", allow(shadow_reuse))]
1314
#![cfg_attr(target_os = "linux", feature(linkage))]
1415
#![no_std]

stdsimd/arch/detect/cache.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ use core::sync::atomic::AtomicU64;
1212
use core::sync::atomic::AtomicU32;
1313

1414
/// Sets the `bit` of `x`.
15+
#[promotable_const_fn]
1516
pub const fn set_bit(x: u64, bit: u32) -> u64 {
1617
x | 1 << bit
1718
}
1819

1920
/// Tests the `bit` of `x`.
21+
#[promotable_const_fn]
2022
pub const fn test_bit(x: u64, bit: u32) -> bool {
2123
x & (1 << bit) != 0
2224
}

0 commit comments

Comments
 (0)