1111{
1212 type Output = I :: Output ;
1313
14- #[ inline( always) ]
14+ #[ cfg_attr( bootstrap, inline( always) ) ]
15+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
1516 fn index ( & self , index : I ) -> & I :: Output {
1617 index. index ( self )
1718 }
@@ -22,7 +23,8 @@ impl<T, I> ops::IndexMut<I> for [T]
2223where
2324 I : SliceIndex < [ T ] > ,
2425{
25- #[ inline( always) ]
26+ #[ cfg_attr( bootstrap, inline( always) ) ]
27+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
2628 fn index_mut ( & mut self , index : I ) -> & mut I :: Output {
2729 index. index_mut ( self )
2830 }
@@ -455,7 +457,8 @@ unsafe impl<T> SliceIndex<[T]> for ops::Range<usize> {
455457 }
456458 }
457459
458- #[ inline( always) ]
460+ #[ cfg_attr( bootstrap, inline( always) ) ]
461+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
459462 fn index ( self , slice : & [ T ] ) -> & [ T ] {
460463 // Using checked_sub is a safe way to get `SubUnchecked` in MIR
461464 let Some ( new_len) = usize:: checked_sub ( self . end , self . start ) else {
@@ -507,7 +510,8 @@ unsafe impl<T> SliceIndex<[T]> for range::Range<usize> {
507510 unsafe { ops:: Range :: from ( self ) . get_unchecked_mut ( slice) }
508511 }
509512
510- #[ inline( always) ]
513+ #[ cfg_attr( bootstrap, inline( always) ) ]
514+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
511515 fn index ( self , slice : & [ T ] ) -> & [ T ] {
512516 ops:: Range :: from ( self ) . index ( slice)
513517 }
@@ -545,7 +549,8 @@ unsafe impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
545549 unsafe { ( 0 ..self . end ) . get_unchecked_mut ( slice) }
546550 }
547551
548- #[ inline( always) ]
552+ #[ cfg_attr( bootstrap, inline( always) ) ]
553+ #[ cfg_attr( not( bootstrap) , inline( usually) ) ]
549554 fn index ( self , slice : & [ T ] ) -> & [ T ] {
550555 ( 0 ..self . end ) . index ( slice)
551556 }
0 commit comments