Skip to content

Commit 5f0b37b

Browse files
authored
Merge pull request #1 from Freax13/master
switch to AllocRef after 2020-02-02
2 parents 1a3d5ee + 7b669ce commit 5f0b37b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ use_spin = ["spin"]
1717
[dependencies.spin]
1818
version = "0.5"
1919
optional = true
20+
21+
[dependencies]
22+
rustversion = "1.0"

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(const_fn)]
22
#![feature(alloc, allocator_api)]
33
#![no_std]
4+
#![allow(stable_features)]
45

56
#[cfg(test)]
67
#[macro_use]
@@ -11,7 +12,11 @@ extern crate spin;
1112

1213
extern crate alloc;
1314

14-
use alloc::alloc::{Alloc, AllocErr, Layout};
15+
#[rustversion::before(2020-02-02)]
16+
use alloc::alloc::Alloc;
17+
#[rustversion::since(2020-02-02)]
18+
use alloc::alloc::AllocRef as Alloc;
19+
use alloc::alloc::{AllocErr, Layout};
1520
use core::alloc::GlobalAlloc;
1621
use core::cmp::{max, min};
1722
use core::fmt;
@@ -264,8 +269,6 @@ unsafe impl GlobalAlloc for LockedHeap {
264269
}
265270
}
266271

267-
use alloc::boxed::Box;
268-
269272
/// A locked version of `Heap` with rescue before oom
270273
///
271274
/// # Usage

0 commit comments

Comments
 (0)