Skip to content

Commit 7c77ada

Browse files
committed
Allow deprecated mem::uninitialized
1 parent 4d952ef commit 7c77ada

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

crossbeam-epoch/src/deferred.rs

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ impl Deferred {
3636

3737
unsafe {
3838
if size <= mem::size_of::<Data>() && align <= mem::align_of::<Data>() {
39+
// TODO(taiki-e): when the minimum supported Rust version is bumped to 1.36+,
40+
// replace this with `mem::MaybeUninit`.
41+
#[allow(deprecated)]
3942
let mut data: Data = mem::uninitialized();
4043
ptr::write(&mut data as *mut Data as *mut F, f);
4144

@@ -51,6 +54,9 @@ impl Deferred {
5154
}
5255
} else {
5356
let b: Box<F> = Box::new(f);
57+
// TODO(taiki-e): when the minimum supported Rust version is bumped to 1.36+,
58+
// replace this with `mem::MaybeUninit`.
59+
#[allow(deprecated)]
5460
let mut data: Data = mem::uninitialized();
5561
ptr::write(&mut data as *mut Data as *mut Box<F>, b);
5662

crossbeam-epoch/src/sync/queue.rs

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ impl<T> Queue<T> {
4646
head: CachePadded::new(Atomic::null()),
4747
tail: CachePadded::new(Atomic::null()),
4848
};
49+
// TODO(taiki-e): when the minimum supported Rust version is bumped to 1.36+,
50+
// replace this with `mem::MaybeUninit`.
51+
#[allow(deprecated)]
4952
let sentinel = Owned::new(Node {
5053
data: unsafe { mem::uninitialized() },
5154
next: Atomic::null(),

0 commit comments

Comments
 (0)