Skip to content

Commit

Permalink
Merge pull request #501 from rust-osdev/remove-const_mut_refs-feature
Browse files Browse the repository at this point in the history
Remove stabilized `const_mut_refs` feature
  • Loading branch information
Freax13 authored Oct 8, 2024
2 parents 7b47163 + d3e28e9 commit 8adb26d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 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
6 changes: 2 additions & 4 deletions src/structures/gdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ 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 {
pub const fn append(&mut self, entry: Descriptor) -> SegmentSelector {
let index = match entry {
Descriptor::UserSegment(value) => {
if self.len > self.table.len().saturating_sub(1) {
Expand Down Expand Up @@ -246,8 +245,7 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
}

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

0 comments on commit 8adb26d

Please sign in to comment.