mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
21 lines
421 B
Rust
21 lines
421 B
Rust
//@ check-pass
|
|
|
|
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() {}
|