Skip to content

Commit

Permalink
std::hint::black_box is not stable until 1.66
Browse files Browse the repository at this point in the history
  • Loading branch information
james7132 authored and Amanieu committed Feb 20, 2024
1 parent 66a0d00 commit 0f6c705
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ unsafe fn deallocate_bucket<T>(bucket: *mut Entry<T>, size: usize) {
mod tests {
use super::ThreadLocal;
use std::cell::RefCell;
use std::hint::black_box;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::Relaxed;
use std::sync::Arc;
Expand Down Expand Up @@ -620,13 +619,13 @@ mod tests {
let _tls = tls2.get_or(|| Box::new(2));
let iter = tls2.iter();
for item in iter {
black_box(item);
println!("{:?}", item);
}
});

let iter = tls.iter();
for item in iter {
black_box(item);
println!("{:?}", item);
}

join_1.join().ok();
Expand Down

0 comments on commit 0f6c705

Please sign in to comment.