Skip to content

Commit

Permalink
Merge pull request #510 from rust-osdev/fix/ci-msrv
Browse files Browse the repository at this point in the history
fix CI job for building on MSRV
  • Loading branch information
Freax13 authored Nov 13, 2024
2 parents f85f015 + def4212 commit 3fc9106
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- nightly
- 1.59
runs-on: ubuntu-latest
env:
# rustup prioritizes environment variables over rust-toolchain.toml files.
RUSTUP_TOOLCHAIN: ${{ matrix.rust }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand Down
6 changes: 4 additions & 2 deletions src/structures/gdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
///
/// Panics if the GDT doesn't have enough free entries.
#[inline]
pub const fn append(&mut self, entry: Descriptor) -> SegmentSelector {
#[rustversion::attr(since(1.83), const)]
pub 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 @@ -245,7 +246,8 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
}

#[inline]
const fn push(&mut self, value: u64) -> usize {
#[rustversion::attr(since(1.83), 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 3fc9106

Please sign in to comment.