mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
Allow inlining for Atomic*::from_ptr
Currently this cannot be inlined, which among other things means it can't be used in `compiler-builtins` [1]. These are trivial functions that should be inlineable, so add `#[inline]`. [1]: https://github.com/rust-lang/compiler-builtins/pull/790#issuecomment-2744371738
This commit is contained in:
@@ -469,6 +469,7 @@ pub const fn new(v: bool) -> AtomicBool {
|
||||
///
|
||||
/// [valid]: crate::ptr#safety
|
||||
/// [Memory model for atomic accesses]: self#memory-model-for-atomic-accesses
|
||||
#[inline]
|
||||
#[stable(feature = "atomic_from_ptr", since = "1.75.0")]
|
||||
#[rustc_const_stable(feature = "const_atomic_from_ptr", since = "1.84.0")]
|
||||
pub const unsafe fn from_ptr<'a>(ptr: *mut bool) -> &'a AtomicBool {
|
||||
@@ -1389,6 +1390,7 @@ pub const fn new(p: *mut T) -> AtomicPtr<T> {
|
||||
///
|
||||
/// [valid]: crate::ptr#safety
|
||||
/// [Memory model for atomic accesses]: self#memory-model-for-atomic-accesses
|
||||
#[inline]
|
||||
#[stable(feature = "atomic_from_ptr", since = "1.75.0")]
|
||||
#[rustc_const_stable(feature = "const_atomic_from_ptr", since = "1.84.0")]
|
||||
pub const unsafe fn from_ptr<'a>(ptr: *mut *mut T) -> &'a AtomicPtr<T> {
|
||||
@@ -2525,6 +2527,7 @@ pub const fn new(v: $int_type) -> Self {
|
||||
///
|
||||
/// [valid]: crate::ptr#safety
|
||||
/// [Memory model for atomic accesses]: self#memory-model-for-atomic-accesses
|
||||
#[inline]
|
||||
#[stable(feature = "atomic_from_ptr", since = "1.75.0")]
|
||||
#[rustc_const_stable(feature = "const_atomic_from_ptr", since = "1.84.0")]
|
||||
pub const unsafe fn from_ptr<'a>(ptr: *mut $int_type) -> &'a $atomic_type {
|
||||
|
||||
Reference in New Issue
Block a user