diff options
| author | bors <bors@rust-lang.org> | 2022-06-01 04:52:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-01 04:52:11 +0000 |
| commit | 395a09c3dafe0c7838c9ca41d2b47bb5e79a5b6d (patch) | |
| tree | b7b09228f4cf273bb5ba55a5355a900a254de04a /library/alloc/src/vec | |
| parent | 02916c4c75912f70b651c0b20b501444ce2ca231 (diff) | |
| parent | 0a7a0ff4d95cad91313ef53238ac28cc48a2a6b4 (diff) | |
| download | rust-395a09c3dafe0c7838c9ca41d2b47bb5e79a5b6d.tar.gz rust-395a09c3dafe0c7838c9ca41d2b47bb5e79a5b6d.zip | |
Auto merge of #97553 - nbdd0121:lib, r=Mark-Simulacrum
Add `#[inline]` to `Vec`'s `Deref/DerefMut` This should help #97552 (although I haven't verified).
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 45947c4f4a5..33cffa643e4 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2495,6 +2495,7 @@ impl<T: Copy, A: Allocator> ExtendFromWithinSpec for Vec<T, A> { impl<T, A: Allocator> ops::Deref for Vec<T, A> { type Target = [T]; + #[inline] fn deref(&self) -> &[T] { unsafe { slice::from_raw_parts(self.as_ptr(), self.len) } } @@ -2502,6 +2503,7 @@ impl<T, A: Allocator> ops::Deref for Vec<T, A> { #[stable(feature = "rust1", since = "1.0.0")] impl<T, A: Allocator> ops::DerefMut for Vec<T, A> { + #[inline] fn deref_mut(&mut self) -> &mut [T] { unsafe { slice::from_raw_parts_mut(self.as_mut_ptr(), self.len) } } |
