about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-04-20 21:45:35 +0100
committerGitHub <noreply@github.com>2024-04-20 21:45:35 +0100
commit224285d9fcd48bf3703d7ed1e895c8c6353747a0 (patch)
treea70b3b38c4c8aeacda7d851d63f743309d3c192a
parent0f17e5ae235460397a76e848639b7e59ad6c3535 (diff)
parent6f36e825946ef7f0938fa2a1bcb3fcd5321c4a18 (diff)
downloadrust-224285d9fcd48bf3703d7ed1e895c8c6353747a0.tar.gz
rust-224285d9fcd48bf3703d7ed1e895c8c6353747a0.zip
Rollup merge of #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.
-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) => {