From fbe0591c6897216042a201795185bc0c0dac42c1 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Fri, 7 Apr 2023 10:14:50 +0000 Subject: [PATCH] Mark `OwnedSlice::{deref, borrow}` as `#[inline]` --- compiler/rustc_data_structures/src/owned_slice.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_data_structures/src/owned_slice.rs b/compiler/rustc_data_structures/src/owned_slice.rs index c0a3cb07194..048401f66c2 100644 --- a/compiler/rustc_data_structures/src/owned_slice.rs +++ b/compiler/rustc_data_structures/src/owned_slice.rs @@ -92,6 +92,7 @@ pub fn try_slice_owned(owner: O, slicer: F) -> Result impl Deref for OwnedSlice { type Target = [u8]; + #[inline] fn deref(&self) -> &[u8] { // Safety: // `self.bytes` is valid per the construction in `slice_owned` @@ -101,6 +102,7 @@ fn deref(&self) -> &[u8] { } impl Borrow<[u8]> for OwnedSlice { + #[inline] fn borrow(&self) -> &[u8] { self }