Skip to content

Commit cc3ed82

Browse files
committed
feature gate Alloc impls behind nightly
1 parent 6eb122a commit cc3ed82

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

wee_alloc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ travis-ci = { repository = "rustwasm/wee_alloc" }
1818

1919
[features]
2020
default = ["size_classes"]
21+
nightly = []
2122

2223
# Enable extra, expensive integrity allocations.
2324
extra_assertions = []

wee_alloc/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ mod neighbors;
272272
mod size_classes;
273273

274274
use const_init::ConstInit;
275-
use core::alloc::{Alloc, AllocErr, GlobalAlloc, Layout};
275+
#[cfg(feature = "nightly")]
276+
use core::alloc::Alloc;
277+
use core::alloc::{AllocErr, GlobalAlloc, Layout};
276278
use core::cell::Cell;
277279
use core::cmp;
278280
use core::marker::Sync;
@@ -1182,7 +1184,7 @@ impl<'a> WeeAlloc<'a> {
11821184
}
11831185
}
11841186

1185-
#[cfg(nightly)]
1187+
#[cfg(feature = "nightly")]
11861188
unsafe impl<'a, 'b> Alloc for &'b WeeAlloc<'a>
11871189
where
11881190
'a: 'b,

0 commit comments

Comments
 (0)