Skip to content

Commit 4fc44a6

Browse files
authored
Merge pull request #449 from Freax13/enhancement/remove-deprecate
remove deprecated from_bits_unchecked functions
2 parents 47a11c9 + e24d811 commit 4fc44a6

File tree

9 files changed

+0
-98
lines changed

9 files changed

+0
-98
lines changed

src/registers/control.rs

-24
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ bitflags! {
5151
}
5252
}
5353

54-
impl Cr0Flags {
55-
#[deprecated = "use the safe `from_bits_retain` method instead"]
56-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
57-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
58-
Self::from_bits_retain(bits)
59-
}
60-
}
61-
6254
/// Contains the Page Fault Linear Address (PFLA).
6355
///
6456
/// When a page fault occurs, the CPU sets this register to the faulting virtual address.
@@ -82,14 +74,6 @@ bitflags! {
8274
}
8375
}
8476

85-
impl Cr3Flags {
86-
#[deprecated = "use the safe `from_bits_retain` method instead"]
87-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
88-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
89-
Self::from_bits_retain(bits)
90-
}
91-
}
92-
9377
/// Contains various control flags that enable architectural extensions, and
9478
/// indicate support for specific processor capabilities.
9579
#[derive(Debug)]
@@ -175,14 +159,6 @@ bitflags! {
175159
}
176160
}
177161

178-
impl Cr4Flags {
179-
#[deprecated = "use the safe `from_bits_retain` method instead"]
180-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
181-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
182-
Self::from_bits_retain(bits)
183-
}
184-
}
185-
186162
#[cfg(feature = "instructions")]
187163
mod x86_64 {
188164
use super::*;

src/registers/debug.rs

-12
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ impl Dr6Flags {
160160
DebugAddressRegisterNumber::Dr3 => Self::TRAP3,
161161
}
162162
}
163-
164-
#[deprecated = "use the safe `from_bits_retain` method instead"]
165-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
166-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
167-
Self::from_bits_retain(bits)
168-
}
169163
}
170164

171165
bitflags! {
@@ -239,12 +233,6 @@ impl Dr7Flags {
239233
DebugAddressRegisterNumber::Dr3 => Self::GLOBAL_BREAKPOINT_3_ENABLE,
240234
}
241235
}
242-
243-
#[deprecated = "use the safe `from_bits_retain` method instead"]
244-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
245-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
246-
Self::from_bits_retain(bits)
247-
}
248236
}
249237

250238
/// The condition for a hardware breakpoint.

src/registers/model_specific.rs

-16
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,6 @@ bitflags! {
132132
}
133133
}
134134

135-
impl EferFlags {
136-
#[deprecated = "use the safe `from_bits_retain` method instead"]
137-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
138-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
139-
Self::from_bits_retain(bits)
140-
}
141-
}
142-
143135
bitflags! {
144136
/// Flags stored in IA32_U_CET and IA32_S_CET (Table-2-2 in Intel SDM Volume
145137
/// 4). The Intel SDM-equivalent names are described in parentheses.
@@ -165,14 +157,6 @@ bitflags! {
165157
}
166158
}
167159

168-
impl CetFlags {
169-
#[deprecated = "use the safe `from_bits_retain` method instead"]
170-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
171-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
172-
Self::from_bits_retain(bits)
173-
}
174-
}
175-
176160
#[cfg(feature = "instructions")]
177161
mod x86_64 {
178162
use super::*;

src/registers/mxcsr.rs

-8
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ impl Default for MxCsr {
6060
}
6161
}
6262

63-
impl MxCsr {
64-
#[deprecated = "use the safe `from_bits_retain` method instead"]
65-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
66-
pub const unsafe fn from_bits_unchecked(bits: u32) -> Self {
67-
Self::from_bits_retain(bits)
68-
}
69-
}
70-
7163
#[cfg(feature = "instructions")]
7264
mod x86_64 {
7365
use super::*;

src/registers/rflags.rs

-8
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ bitflags! {
6464
}
6565
}
6666

67-
impl RFlags {
68-
#[deprecated = "use the safe `from_bits_retain` method instead"]
69-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
70-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
71-
Self::from_bits_retain(bits)
72-
}
73-
}
74-
7567
#[cfg(feature = "instructions")]
7668
mod x86_64 {
7769
use super::*;

src/registers/xcontrol.rs

-8
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ bitflags! {
5050
}
5151
}
5252

53-
impl XCr0Flags {
54-
#[deprecated = "use the safe `from_bits_retain` method instead"]
55-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
56-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
57-
Self::from_bits_retain(bits)
58-
}
59-
}
60-
6153
#[cfg(feature = "instructions")]
6254
mod x86_64 {
6355
use super::*;

src/structures/gdt.rs

-6
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,6 @@ impl DescriptorFlags {
357357
/// A 64-bit user code segment
358358
pub const USER_CODE64: Self =
359359
Self::from_bits_truncate(Self::KERNEL_CODE64.bits() | Self::DPL_RING_3.bits());
360-
361-
#[deprecated = "use the safe `from_bits_retain` method instead"]
362-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
363-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
364-
Self::from_bits_retain(bits)
365-
}
366360
}
367361

368362
impl Descriptor {

src/structures/idt.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1115,14 +1115,6 @@ bitflags! {
11151115
}
11161116
}
11171117

1118-
impl PageFaultErrorCode {
1119-
#[deprecated = "use the safe `from_bits_retain` method instead"]
1120-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
1121-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
1122-
Self::from_bits_retain(bits)
1123-
}
1124-
}
1125-
11261118
/// Describes an error code referencing a segment selector.
11271119
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
11281120
#[repr(transparent)]

src/structures/paging/page_table.rs

-8
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,6 @@ bitflags! {
169169
}
170170
}
171171

172-
impl PageTableFlags {
173-
#[deprecated = "use the safe `from_bits_retain` method instead"]
174-
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
175-
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
176-
Self::from_bits_retain(bits)
177-
}
178-
}
179-
180172
/// The number of entries in a page table.
181173
const ENTRY_COUNT: usize = 512;
182174

0 commit comments

Comments
 (0)