diff options
| author | Ben Kimock <kimockb@gmail.com> | 2024-02-15 00:26:45 -0500 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2024-02-19 20:38:11 -0500 |
| commit | 4a12f8278538e020fcff7d48b4d30b4838b487b6 (patch) | |
| tree | 99768e03a2d2325f4464a7ab92d189dd4b676134 | |
| parent | 581e171773a0e4bf398d4b7df0e30a7aae627f0b (diff) | |
| download | rust-4a12f8278538e020fcff7d48b4d30b4838b487b6.tar.gz rust-4a12f8278538e020fcff7d48b4d30b4838b487b6.zip | |
Add more inline(always) to fix opt-level=z test on wasm32
| -rw-r--r-- | library/core/src/slice/index.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/slice/index.rs b/library/core/src/slice/index.rs index 86bfdcbd70c..0e2d45c4ada 100644 --- a/library/core/src/slice/index.rs +++ b/library/core/src/slice/index.rs @@ -390,7 +390,7 @@ unsafe impl<T> SliceIndex<[T]> for ops::Range<usize> { } } - #[inline] + #[inline(always)] fn index(self, slice: &[T]) -> &[T] { if self.start > self.end { slice_index_order_fail(self.start, self.end); @@ -440,7 +440,7 @@ unsafe impl<T> SliceIndex<[T]> for ops::RangeTo<usize> { unsafe { (0..self.end).get_unchecked_mut(slice) } } - #[inline] + #[inline(always)] fn index(self, slice: &[T]) -> &[T] { (0..self.end).index(slice) } |
