Skip to content

Commit a29322f

Browse files
committed
build(deps): upgrade allocator-api2 to 0.3
See the projects README for the reasons for removing the nightly feature: https://github.com/zakarumych/allocator-api2/tree/2873b737304003b1cf0c999f4148497293cc9e0f#usage
1 parent 78facd4 commit a29322f

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ all-features = true
1414
rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[dependencies]
17-
allocator-api2 = { version = "0.2", default-features = false, features = ["alloc"], optional = true }
17+
allocator-api2 = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
1818
bitfield-struct = "0.11"
1919
bitflags = "2"
2020
endian-num = { version = "0.2", features = ["bitflags", "linux-types"] }
@@ -28,6 +28,6 @@ zerocopy-derive = { version = "0.8", optional = true }
2828
[features]
2929
alloc = ["dep:allocator-api2"]
3030
mmio = []
31-
nightly = ["allocator-api2/nightly"]
31+
nightly = []
3232
pci = ["dep:pci_types"]
3333
zerocopy = ["dep:zerocopy", "dep:zerocopy-derive", "endian-num/zerocopy"]

src/virtq/alloc.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
use ::alloc::alloc::handle_alloc_error;
2-
use allocator_api2::alloc::{AllocError, Allocator, Global};
3-
use allocator_api2::boxed::Box;
2+
#[cfg(feature = "nightly")]
3+
use ::alloc::{
4+
alloc::{AllocError, Allocator, Global},
5+
boxed::Box,
6+
};
7+
#[cfg(not(feature = "nightly"))]
8+
use allocator_api2::{
9+
alloc::{AllocError, Allocator, Global},
10+
boxed::Box,
11+
};
412

513
use super::*;
614

0 commit comments

Comments
 (0)