Skip to content

Commit 224285d

Browse files
authored
Rollup merge of rust-lang#123967 - RalfJung:static_mut_refs, r=Nilstrieb
static_mut_refs: use raw pointers to remove the remaining FIXME Using `SyncUnsafeCell` would not make a lot of sense IMO.
2 parents 0f17e5a + 6f36e82 commit 224285d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

example/mini_core_hello_world.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![feature(
44
no_core, unboxed_closures, start, lang_items, never_type, linkage,
5-
extern_types, thread_local
5+
extern_types, thread_local, raw_ref_op
66
)]
77
#![no_core]
88
#![allow(dead_code, internal_features, non_camel_case_types)]
@@ -99,9 +99,7 @@ fn start<T: Termination + 'static>(
9999

100100
static mut NUM: u8 = 6 * 7;
101101

102-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
103-
#[allow(static_mut_refs)]
104-
static NUM_REF: &'static u8 = unsafe { &NUM };
102+
static NUM_REF: &'static u8 = unsafe { &* &raw const NUM };
105103

106104
macro_rules! assert {
107105
($e:expr) => {

0 commit comments

Comments
 (0)