about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
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
commitccd9880769304d41fefcdb028c1df646603bcc4e (patch)
treec34c859ce22c5303b3e4d6a52a53ef2c57ef59b0 /compiler/rustc_codegen_gcc
parente9e936cfa8dfdd1b7320a219316b6bd6dbccf300 (diff)
parentb4a46457581e9c777af8d31a9e1cd145d8c1be31 (diff)
downloadrust-ccd9880769304d41fefcdb028c1df646603bcc4e.tar.gz
rust-ccd9880769304d41fefcdb028c1df646603bcc4e.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.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
-rw-r--r--compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs
index add77880716..5a7ddc4cd7f 100644
--- a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs
+++ b/compiler/rustc_codegen_gcc/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) => {