Skip to content

Commit 72d9aa4

Browse files
committed
Fix macro import in alloctests
1 parent efe2269 commit 72d9aa4

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
@@ -52,6 +52,7 @@
5252
#![feature(negative_impls)]
5353
#![feature(never_type)]
5454
#![feature(optimize_attribute)]
55+
#![feature(prelude_import)]
5556
#![feature(rustc_allow_const_fn_unstable)]
5657
#![feature(rustc_attrs)]
5758
#![feature(staged_api)]
@@ -61,10 +62,17 @@
6162

6263
// Allow testing this library
6364
extern crate alloc as realalloc;
65+
66+
// This is needed to provide macros to the directly imported alloc modules below.
67+
#[prelude_import]
68+
#[allow(unused_imports)]
69+
use std::prelude::rust_2024::*;
6470
extern crate std;
71+
6572
#[cfg(test)]
6673
extern crate test;
6774
mod testing;
75+
6876
use realalloc::*;
6977

7078
// We are directly including collections and raw_vec here as both use non-public
@@ -85,8 +93,7 @@ pub(crate) mod test_helpers {
8593
let mut hasher = std::hash::RandomState::new().build_hasher();
8694
std::panic::Location::caller().hash(&mut hasher);
8795
let hc64 = hasher.finish();
88-
let seed_vec =
89-
hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<crate::vec::Vec<u8>>();
96+
let seed_vec = hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<std::vec::Vec<u8>>();
9097
let seed: [u8; 16] = seed_vec.as_slice().try_into().unwrap();
9198
rand::SeedableRng::from_seed(seed)
9299
}

0 commit comments

Comments
 (0)