Skip to content

Commit

Permalink
Remove stabilized const_mut_refs feature
Browse files Browse the repository at this point in the history
Make `GDT::append` and `GDT::push` `const` by default. The `const_fn` feature is now a no-op.
  • Loading branch information
phil-opp committed Oct 7, 2024
1 parent 7b47163 commit 7278462
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ rustversion = "1.0.5"
[features]
default = ["nightly", "instructions"]
instructions = []
nightly = [ "const_fn", "step_trait", "abi_x86_interrupt", "asm_const" ]
nightly = ["const_fn", "step_trait", "abi_x86_interrupt", "asm_const"]
abi_x86_interrupt = []
# deprecated, no longer needed
const_fn = []
asm_const = []
step_trait = []
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! and access to various system registers.
#![cfg_attr(not(test), no_std)]
#![cfg_attr(feature = "const_fn", feature(const_mut_refs))] // GDT::append()
#![cfg_attr(feature = "abi_x86_interrupt", feature(abi_x86_interrupt))]
#![cfg_attr(feature = "step_trait", feature(step_trait))]
#![cfg_attr(feature = "doc_auto_cfg", feature(doc_auto_cfg))]
Expand Down
2 changes: 0 additions & 2 deletions src/structures/gdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
///
/// Panics if the GDT doesn't have enough free entries.
#[inline]
#[cfg_attr(feature = "const_fn", rustversion::attr(all(), const))]
pub fn append(&mut self, entry: Descriptor) -> SegmentSelector {
let index = match entry {
Descriptor::UserSegment(value) => {
Expand Down Expand Up @@ -246,7 +245,6 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
}

#[inline]
#[cfg_attr(feature = "const_fn", rustversion::attr(all(), const))]
fn push(&mut self, value: u64) -> usize {
let index = self.len;
self.table[index] = Entry::new(value);
Expand Down

0 comments on commit 7278462

Please sign in to comment.