Skip to content

Commit 3fc9106

Browse files
authored
Merge pull request #510 from rust-osdev/fix/ci-msrv
fix CI job for building on MSRV
2 parents f85f015 + def4212 commit 3fc9106

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- nightly
2727
- 1.59
2828
runs-on: ubuntu-latest
29+
env:
30+
# rustup prioritizes environment variables over rust-toolchain.toml files.
31+
RUSTUP_TOOLCHAIN: ${{ matrix.rust }}
2932
steps:
3033
- uses: actions/checkout@v4
3134
- uses: dtolnay/rust-toolchain@master

src/structures/gdt.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
193193
///
194194
/// Panics if the GDT doesn't have enough free entries.
195195
#[inline]
196-
pub const fn append(&mut self, entry: Descriptor) -> SegmentSelector {
196+
#[rustversion::attr(since(1.83), const)]
197+
pub fn append(&mut self, entry: Descriptor) -> SegmentSelector {
197198
let index = match entry {
198199
Descriptor::UserSegment(value) => {
199200
if self.len > self.table.len().saturating_sub(1) {
@@ -245,7 +246,8 @@ impl<const MAX: usize> GlobalDescriptorTable<MAX> {
245246
}
246247

247248
#[inline]
248-
const fn push(&mut self, value: u64) -> usize {
249+
#[rustversion::attr(since(1.83), const)]
250+
fn push(&mut self, value: u64) -> usize {
249251
let index = self.len;
250252
self.table[index] = Entry::new(value);
251253
self.len += 1;

0 commit comments

Comments
 (0)