Skip to content

Commit 5e4771a

Browse files
committed
Fix macro import in alloctests
1 parent 1b2ada3 commit 5e4771a

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
@@ -56,6 +56,7 @@
5656
#![feature(negative_impls)]
5757
#![feature(never_type)]
5858
#![feature(optimize_attribute)]
59+
#![feature(prelude_import)]
5960
#![feature(rustc_allow_const_fn_unstable)]
6061
#![feature(rustc_attrs)]
6162
#![feature(staged_api)]
@@ -65,10 +66,17 @@
6566

6667
// Allow testing this library
6768
extern crate alloc as realalloc;
69+
70+
// This is needed to provide macros to the directly imported alloc modules below.
71+
#[prelude_import]
72+
#[allow(unused_imports)]
73+
use std::prelude::rust_2024::*;
6874
extern crate std;
75+
6976
#[cfg(test)]
7077
extern crate test;
7178
mod testing;
79+
7280
use realalloc::*;
7381

7482
// We are directly including collections, raw_vec, and wtf8 here as they use non-public
@@ -92,8 +100,7 @@ pub(crate) mod test_helpers {
92100
let mut hasher = std::hash::RandomState::new().build_hasher();
93101
std::panic::Location::caller().hash(&mut hasher);
94102
let hc64 = hasher.finish();
95-
let seed_vec =
96-
hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<crate::vec::Vec<u8>>();
103+
let seed_vec = hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<std::vec::Vec<u8>>();
97104
let seed: [u8; 16] = seed_vec.as_slice().try_into().unwrap();
98105
rand::SeedableRng::from_seed(seed)
99106
}

0 commit comments

Comments
 (0)