about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-04-15 17:45:04 +0200
committerRalf Jung <post@ralfj.de>2024-04-15 18:45:56 +0200
commit6f36e825946ef7f0938fa2a1bcb3fcd5321c4a18 (patch)
tree5c1ba4e7154054632c27044b35fa581c4e5f84d1 /example
parentcccf379a5bd7096b970277db70f72055ff01a5e8 (diff)
downloadrust-6f36e825946ef7f0938fa2a1bcb3fcd5321c4a18.tar.gz
rust-6f36e825946ef7f0938fa2a1bcb3fcd5321c4a18.zip
static_mut_refs: use raw pointers to remove the remaining FIXME
Diffstat (limited to 'example')
-rw-r--r--example/mini_core_hello_world.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index add77880716..5a7ddc4cd7f 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -2,7 +2,7 @@
 
 #![feature(
     no_core, unboxed_closures, start, lang_items, never_type, linkage,
-    extern_types, thread_local
+    extern_types, thread_local, raw_ref_op
 )]
 #![no_core]
 #![allow(dead_code, internal_features, non_camel_case_types)]
@@ -99,9 +99,7 @@ fn start<T: Termination + 'static>(
 
 static mut NUM: u8 = 6 * 7;
 
-// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
-#[allow(static_mut_refs)]
-static NUM_REF: &'static u8 = unsafe { &NUM };
+static NUM_REF: &'static u8 = unsafe { &* &raw const NUM };
 
 macro_rules! assert {
     ($e:expr) => {