From ba51f3101fc2b947aa70a99cbad9719b410c3538 Mon Sep 17 00:00:00 2001 From: yvt Date: Fri, 19 Feb 2021 20:52:00 +0900 Subject: [PATCH] refactor: remove `#![feature(raw_ref_macros)]`, start using it everywhere `raw_ref_macros` has been stabilized by . --- src/r3/src/lib.rs | 1 - src/r3_port_arm/src/sp804/cfg.rs | 3 +-- src/r3_port_riscv/src/timer/cfg.rs | 3 +-- src/r3_port_riscv_test_driver/src/main.rs | 1 - src/r3_support_rza1/src/os_timer/cfg.rs | 3 +-- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/r3/src/lib.rs b/src/r3/src/lib.rs index 3c42f8949d..3199bfccb2 100644 --- a/src/r3/src/lib.rs +++ b/src/r3/src/lib.rs @@ -13,7 +13,6 @@ #![feature(exhaustive_patterns)] // `let Ok(()) = Ok::<(), !>(())` #![feature(decl_macro)] #![feature(set_ptr_value)] // `<*const T>::set_ptr_value` -#![feature(raw_ref_macros)] #![feature(or_patterns)] #![feature(option_result_unwrap_unchecked)] // `Option::unwrap_unchecked` #![feature(cfg_target_has_atomic)] // `#[cfg(target_has_atomic_load_store)]` diff --git a/src/r3_port_arm/src/sp804/cfg.rs b/src/r3_port_arm/src/sp804/cfg.rs index 6cb242216f..5c23aaaaa9 100644 --- a/src/r3_port_arm/src/sp804/cfg.rs +++ b/src/r3_port_arm/src/sp804/cfg.rs @@ -93,8 +93,7 @@ macro_rules! use_sp804 { type TicklessState = tickless::TicklessState; fn tickless_state() -> *mut Self::TicklessState { - // FIXME: Use `core::ptr::addr_of_mut!` when it's stable - unsafe { &mut TIMER_STATE } + unsafe { core::ptr::addr_of_mut!(TIMER_STATE) } } } diff --git a/src/r3_port_riscv/src/timer/cfg.rs b/src/r3_port_riscv/src/timer/cfg.rs index 3380b27060..a020401046 100644 --- a/src/r3_port_riscv/src/timer/cfg.rs +++ b/src/r3_port_riscv/src/timer/cfg.rs @@ -97,8 +97,7 @@ macro_rules! use_timer { type TicklessState = tickless::TicklessState; fn tickless_state() -> *mut Self::TicklessState { - // FIXME: Use `core::ptr::addr_of_mut!` when it's stable - unsafe { &mut TIMER_STATE } + unsafe { core::ptr::addr_of_mut!(TIMER_STATE) } } } diff --git a/src/r3_port_riscv_test_driver/src/main.rs b/src/r3_port_riscv_test_driver/src/main.rs index 5faf2a5601..e90714cb1b 100644 --- a/src/r3_port_riscv_test_driver/src/main.rs +++ b/src/r3_port_riscv_test_driver/src/main.rs @@ -5,7 +5,6 @@ #![feature(naked_functions)] #![feature(global_asm)] #![feature(decl_macro)] -#![feature(raw_ref_macros)] #![feature(const_ptr_offset)] #![feature(unsafe_block_in_unsafe_fn)] // `unsafe fn` doesn't imply `unsafe {}` #![deny(unsafe_op_in_unsafe_fn)] diff --git a/src/r3_support_rza1/src/os_timer/cfg.rs b/src/r3_support_rza1/src/os_timer/cfg.rs index 553eb26753..066e41eb81 100644 --- a/src/r3_support_rza1/src/os_timer/cfg.rs +++ b/src/r3_support_rza1/src/os_timer/cfg.rs @@ -92,8 +92,7 @@ macro_rules! use_os_timer { type TicklessState = tickless::TicklessState; fn tickless_state() -> *mut Self::TicklessState { - // FIXME: Use `core::ptr::addr_of_mut!` when it's stable - unsafe { &mut TIMER_STATE } + unsafe { core::ptr::addr_of_mut!(TIMER_STATE) } } }