Skip to content

Commit 8bb14c4

Browse files
committed
Fix macro import in alloctests
1 parent 14e9e71 commit 8bb14c4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

library/alloctests/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#![feature(negative_impls)]
6060
#![feature(never_type)]
6161
#![feature(optimize_attribute)]
62+
#![feature(prelude_import)]
6263
#![feature(rustc_allow_const_fn_unstable)]
6364
#![feature(rustc_attrs)]
6465
#![feature(staged_api)]
@@ -68,10 +69,17 @@
6869

6970
// Allow testing this library
7071
extern crate alloc as realalloc;
72+
73+
// This is needed to provide macros to the directly imported alloc modules below.
74+
#[prelude_import]
75+
#[allow(unused_imports)]
76+
use std::prelude::rust_2024::*;
7177
extern crate std;
78+
7279
#[cfg(test)]
7380
extern crate test;
7481
mod testing;
82+
7583
use realalloc::*;
7684

7785
// We are directly including collections, raw_vec, and wtf8 here as they use non-public
@@ -95,8 +103,7 @@ pub(crate) mod test_helpers {
95103
let mut hasher = std::hash::RandomState::new().build_hasher();
96104
std::panic::Location::caller().hash(&mut hasher);
97105
let hc64 = hasher.finish();
98-
let seed_vec =
99-
hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<crate::vec::Vec<u8>>();
106+
let seed_vec = hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<std::vec::Vec<u8>>();
100107
let seed: [u8; 16] = seed_vec.as_slice().try_into().unwrap();
101108
rand::SeedableRng::from_seed(seed)
102109
}

0 commit comments

Comments
 (0)