From beadbfd19482ba9976092b193c102b17fb89137d Mon Sep 17 00:00:00 2001 From: James Miller Date: Thu, 4 Jun 2015 16:20:48 +1200 Subject: [PATCH] Mark std::as_bytes as inline 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. --- src/libcollections/str.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index aa9be37c9cc..95bf6d0a9cd 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -1466,6 +1466,7 @@ impl str { /// assert_eq!("bors".as_bytes(), b"bors"); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[inline(always)] pub fn as_bytes(&self) -> &[u8] { core_str::StrExt::as_bytes(&self[..]) }