We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd6b336 commit ca109afCopy full SHA for ca109af
tests/ui/statics/recursive_interior_mut.rs
@@ -0,0 +1,20 @@
1
+// check-pass
2
+
3
+use std::cell::Cell;
4
+use std::ptr::NonNull;
5
6
+struct ChunkFooter {
7
+ prev: Cell<NonNull<ChunkFooter>>,
8
+}
9
10
+struct EmptyChunkFooter(ChunkFooter);
11
12
+unsafe impl Sync for EmptyChunkFooter {}
13
14
+static EMPTY_CHUNK: EmptyChunkFooter = EmptyChunkFooter(ChunkFooter {
15
+ prev: Cell::new(unsafe {
16
+ NonNull::new_unchecked(&EMPTY_CHUNK as *const EmptyChunkFooter as *mut ChunkFooter)
17
+ }),
18
+});
19
20
+fn main() {}
0 commit comments