2 static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 };
4 struct StaticDoubleLinked {
5 prev: &'static StaticDoubleLinked,
6 next: &'static StaticDoubleLinked,
11 static L1: StaticDoubleLinked = StaticDoubleLinked{prev: &L3, next: &L2, data: 1, head: true};
12 static L2: StaticDoubleLinked = StaticDoubleLinked{prev: &L1, next: &L3, data: 2, head: false};
13 static L3: StaticDoubleLinked = StaticDoubleLinked{prev: &L2, next: &L1, data: 3, head: false};
17 unsafe { assert_eq!(S, *(S as *const *const u8)); }
19 let mut test_vec = Vec::new();
22 test_vec.push(cur.data);
26 assert_eq!(&test_vec, &[1,2,3]);
28 let mut test_vec = Vec::new();
32 test_vec.push(cur.data);
35 assert_eq!(&test_vec, &[3,2,1]);