@@ -813,12 +813,14 @@ fn panic_already_mutably_borrowed(err: BorrowError) -> ! {
813
813
type BorrowFlag = isize ;
814
814
const UNUSED : BorrowFlag = 0 ;
815
815
816
- #[ inline( always) ]
816
+ #[ cfg_attr( bootstrap, inline( always) ) ]
817
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
817
818
fn is_writing ( x : BorrowFlag ) -> bool {
818
819
x < UNUSED
819
820
}
820
821
821
- #[ inline( always) ]
822
+ #[ cfg_attr( bootstrap, inline( always) ) ]
823
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
822
824
fn is_reading ( x : BorrowFlag ) -> bool {
823
825
x > UNUSED
824
826
}
@@ -2079,7 +2081,8 @@ impl<T> UnsafeCell<T> {
2079
2081
/// ```
2080
2082
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2081
2083
#[ rustc_const_stable( feature = "const_unsafe_cell_new" , since = "1.32.0" ) ]
2082
- #[ inline( always) ]
2084
+ #[ cfg_attr( bootstrap, inline( always) ) ]
2085
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2083
2086
pub const fn new ( value : T ) -> UnsafeCell < T > {
2084
2087
UnsafeCell { value }
2085
2088
}
@@ -2095,7 +2098,8 @@ impl<T> UnsafeCell<T> {
2095
2098
///
2096
2099
/// let five = uc.into_inner();
2097
2100
/// ```
2098
- #[ inline( always) ]
2101
+ #[ cfg_attr( bootstrap, inline( always) ) ]
2102
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2099
2103
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2100
2104
// When this is const stabilized, please remove `primitive_into_inner` below.
2101
2105
#[ rustc_const_unstable( feature = "const_cell_into_inner" , issue = "78729" ) ]
@@ -2119,7 +2123,8 @@ impl<T: ?Sized> UnsafeCell<T> {
2119
2123
/// *uc.get_mut() -= 1;
2120
2124
/// assert_eq!(*uc.get_mut(), 41);
2121
2125
/// ```
2122
- #[ inline( always) ]
2126
+ #[ cfg_attr( bootstrap, inline( always) ) ]
2127
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2123
2128
#[ unstable( feature = "unsafe_cell_from_mut" , issue = "111645" ) ]
2124
2129
pub const fn from_mut ( value : & mut T ) -> & mut UnsafeCell < T > {
2125
2130
// SAFETY: `UnsafeCell<T>` has the same memory layout as `T` due to #[repr(transparent)].
@@ -2142,7 +2147,8 @@ impl<T: ?Sized> UnsafeCell<T> {
2142
2147
///
2143
2148
/// let five = uc.get();
2144
2149
/// ```
2145
- #[ inline( always) ]
2150
+ #[ cfg_attr( bootstrap, inline( always) ) ]
2151
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2146
2152
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2147
2153
#[ rustc_const_stable( feature = "const_unsafecell_get" , since = "1.32.0" ) ]
2148
2154
#[ rustc_never_returns_null_ptr]
@@ -2168,7 +2174,8 @@ impl<T: ?Sized> UnsafeCell<T> {
2168
2174
///
2169
2175
/// assert_eq!(*c.get_mut(), 6);
2170
2176
/// ```
2171
- #[ inline( always) ]
2177
+ #[ cfg_attr( bootstrap, inline( always) ) ]
2178
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2172
2179
#[ stable( feature = "unsafe_cell_get_mut" , since = "1.50.0" ) ]
2173
2180
#[ rustc_const_unstable( feature = "const_unsafecell_get_mut" , issue = "88836" ) ]
2174
2181
pub const fn get_mut ( & mut self ) -> & mut T {
@@ -2203,7 +2210,8 @@ impl<T: ?Sized> UnsafeCell<T> {
2203
2210
///
2204
2211
/// assert_eq!(uc.into_inner(), 5);
2205
2212
/// ```
2206
- #[ inline( always) ]
2213
+ #[ cfg_attr( bootstrap, inline( always) ) ]
2214
+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2207
2215
#[ stable( feature = "unsafe_cell_raw_get" , since = "1.56.0" ) ]
2208
2216
#[ rustc_const_stable( feature = "unsafe_cell_raw_get" , since = "1.56.0" ) ]
2209
2217
#[ rustc_diagnostic_item = "unsafe_cell_raw_get" ]
0 commit comments