2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
2022-09-02 18:12:03 -05:00
|
|
|
|
|
|
|
use std::cell::Cell;
|
|
|
|
use std::ptr::NonNull;
|
|
|
|
|
|
|
|
struct ChunkFooter {
|
|
|
|
prev: Cell<NonNull<ChunkFooter>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct EmptyChunkFooter(ChunkFooter);
|
|
|
|
|
|
|
|
unsafe impl Sync for EmptyChunkFooter {}
|
|
|
|
|
|
|
|
static EMPTY_CHUNK: EmptyChunkFooter = EmptyChunkFooter(ChunkFooter {
|
|
|
|
prev: Cell::new(unsafe {
|
|
|
|
NonNull::new_unchecked(&EMPTY_CHUNK as *const EmptyChunkFooter as *mut ChunkFooter)
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
|
|
|
fn main() {}
|