diff options
| author | Ralf Jung <post@ralfj.de> | 2024-04-15 17:45:04 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-04-15 18:45:56 +0200 |
| commit | b4a46457581e9c777af8d31a9e1cd145d8c1be31 (patch) | |
| tree | 0b0a621f0d4d6e02608eb8069076ab2bb021da9c /compiler/rustc_codegen_cranelift/example | |
| parent | 85b884b0582d91e4b2e8ba9968ce50a3f549e8af (diff) | |
static_mut_refs: use raw pointers to remove the remaining FIXME
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index 8b0b9123ac7..efa4be7e15a 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -1,4 +1,13 @@ -#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, repr_simd)] +#![feature( + no_core, + lang_items, + never_type, + linkage, + extern_types, + thread_local, + repr_simd, + raw_ref_op +)] #![no_core] #![allow(dead_code, non_camel_case_types, internal_features)] @@ -112,9 +121,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 }; unsafe fn zeroed<T>() -> T { let mut uninit = MaybeUninit { uninit: () }; |
