Skip to content

Commit 9e4e444

Browse files
committed
static_mut_refs: use raw pointers to remove the remaining FIXME
1 parent e243f8d commit 9e4e444

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

example/mini_core_hello_world.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, repr_simd)]
1+
#![feature(
2+
no_core,
3+
lang_items,
4+
never_type,
5+
linkage,
6+
extern_types,
7+
thread_local,
8+
repr_simd,
9+
raw_ref_op
10+
)]
211
#![no_core]
312
#![allow(dead_code, non_camel_case_types, internal_features)]
413

@@ -112,9 +121,7 @@ fn start<T: Termination + 'static>(
112121

113122
static mut NUM: u8 = 6 * 7;
114123

115-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
116-
#[allow(static_mut_refs)]
117-
static NUM_REF: &'static u8 = unsafe { &NUM };
124+
static NUM_REF: &'static u8 = unsafe { &*&raw const NUM };
118125

119126
unsafe fn zeroed<T>() -> T {
120127
let mut uninit = MaybeUninit { uninit: () };

0 commit comments

Comments
 (0)