Skip to content

Commit 3bcb845

Browse files
authored
Merge pull request #606 from NeuralModder/fix-allocator-api2
Don't enable `allocator-api2/nightly` feature
2 parents d76a3de + b64eb93 commit 3bcb845

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ default = ["default-hasher", "inline-more", "allocator-api2", "equivalent", "raw
4747

4848
# Enables use of nightly features. This is only guaranteed to work on the latest
4949
# version of nightly Rust.
50-
nightly = ["allocator-api2?/nightly", "bumpalo/allocator_api"]
50+
nightly = ["bumpalo/allocator_api"]
5151

5252
# Enables the RustcEntry API used to provide the standard library's Entry API.
5353
rustc-internal-api = []

src/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4690,9 +4690,9 @@ mod test_map {
46904690
use super::Entry::{Occupied, Vacant};
46914691
use super::EntryRef;
46924692
use super::HashMap;
4693+
use crate::raw::{AllocError, Allocator, Global};
46934694
use alloc::string::{String, ToString};
46944695
use alloc::sync::Arc;
4695-
use allocator_api2::alloc::{AllocError, Allocator, Global};
46964696
use core::alloc::Layout;
46974697
use core::ptr::NonNull;
46984698
use core::sync::atomic::{AtomicI8, Ordering};

src/raw/alloc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[cfg(test)]
2+
pub(crate) use self::inner::AllocError;
13
pub(crate) use self::inner::{do_alloc, Allocator, Global};
24

35
// Nightly-case.
@@ -6,6 +8,8 @@ pub(crate) use self::inner::{do_alloc, Allocator, Global};
68
// This is used when building for `std`.
79
#[cfg(feature = "nightly")]
810
mod inner {
11+
#[cfg(test)]
12+
pub use crate::alloc::alloc::AllocError;
913
use crate::alloc::alloc::Layout;
1014
pub use crate::alloc::alloc::{Allocator, Global};
1115
use core::ptr::NonNull;
@@ -28,6 +32,8 @@ mod inner {
2832
#[cfg(all(not(feature = "nightly"), feature = "allocator-api2"))]
2933
mod inner {
3034
use crate::alloc::alloc::Layout;
35+
#[cfg(test)]
36+
pub use allocator_api2::alloc::AllocError;
3137
pub use allocator_api2::alloc::{Allocator, Global};
3238
use core::ptr::NonNull;
3339

src/raw/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use core::slice;
1212
use core::{hint, ptr};
1313

1414
mod alloc;
15+
#[cfg(test)]
16+
pub(crate) use self::alloc::AllocError;
1517
pub(crate) use self::alloc::{do_alloc, Allocator, Global};
1618

1719
#[inline]
@@ -4238,9 +4240,9 @@ mod test_map {
42384240
/// ARE ZERO, EVEN IF WE HAVE `FULL` CONTROL BYTES.
42394241
#[test]
42404242
fn test_catch_panic_clone_from() {
4243+
use super::{AllocError, Allocator, Global};
42414244
use ::alloc::sync::Arc;
42424245
use ::alloc::vec::Vec;
4243-
use allocator_api2::alloc::{AllocError, Allocator, Global};
42444246
use core::sync::atomic::{AtomicI8, Ordering};
42454247
use std::thread;
42464248

0 commit comments

Comments
 (0)