Skip to content

Commit 8599c66

Browse files
authored
Merge pull request #868 from DemonInTheCloset/rust-const-bit
feat: Allow the use of fn bit in a const context
2 parents 1cb292c + a04e91d commit 8599c66

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rust/kernel/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ pub use build_error::build_error;
109109

110110
pub use crate::error::{to_result, Error, Result};
111111
pub use crate::types::{
112-
bit, bits_iter, ARef, AlwaysRefCounted, Bool, Either, Either::Left, Either::Right, False, Mode,
113-
Opaque, PointerWrapper, ScopeGuard, True,
112+
bit, bits_iter, ARef, AlwaysRefCounted, Bit, Bool, Either, Either::Left, Either::Right, False,
113+
Mode, Opaque, PointerWrapper, ScopeGuard, True,
114114
};
115115

116116
use core::marker::PhantomData;

rust/kernel/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ pub struct Bit<T> {
355355
///
356356
/// assert_eq!(y | bit(35), 0xc00000000);
357357
/// ```
358-
pub fn bit<T: Copy>(index: T) -> Bit<T> {
358+
pub const fn bit<T: Copy>(index: T) -> Bit<T> {
359359
Bit {
360360
index,
361361
inverted: false,

0 commit comments

Comments
 (0)