Skip to content

Commit c78c099

Browse files
committed
Auto merge of #26024 - Aatch:inline-as_bytes, r=Gankro
This wasn't marked inline, so wasn't being inlined cross-crate. It's actually a no-op function, since it's a wrapper around `mem::transmute`. Marking it inline means that programs calling it can see that it's a no-op and act accordingly during optimisation.
2 parents 75fb009 + beadbfd commit c78c099

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcollections/str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,7 @@ impl str {
14661466
/// assert_eq!("bors".as_bytes(), b"bors");
14671467
/// ```
14681468
#[stable(feature = "rust1", since = "1.0.0")]
1469+
#[inline(always)]
14691470
pub fn as_bytes(&self) -> &[u8] {
14701471
core_str::StrExt::as_bytes(&self[..])
14711472
}

0 commit comments

Comments
 (0)