rust: add missing const markers for MSRV==1.83.0
Rust 1.83 allows more functions to be marked const. Fix clippy with bumped minimum supported Rust version. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250908105005.2119297-5-pbonzini@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e1c689c218
commit
71e84e5ae8
6 changed files with 14 additions and 16 deletions
|
|
@ -165,19 +165,19 @@ macro_rules! bits {
|
|||
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
pub fn set(&mut self, rhs: Self) {
|
||||
pub const fn set(&mut self, rhs: Self) {
|
||||
self.0 |= rhs.0;
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
pub fn clear(&mut self, rhs: Self) {
|
||||
pub const fn clear(&mut self, rhs: Self) {
|
||||
self.0 &= !rhs.0;
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
pub fn toggle(&mut self, rhs: Self) {
|
||||
pub const fn toggle(&mut self, rhs: Self) {
|
||||
self.0 ^= rhs.0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue