diff options
| author | James Miller <james@aatch.net> | 2015-06-04 16:20:48 +1200 |
|---|---|---|
| committer | James Miller <james@aatch.net> | 2015-06-05 13:53:55 +1200 |
| commit | beadbfd19482ba9976092b193c102b17fb89137d (patch) | |
| tree | 85f950e1ab34e8adebd5d37f23046163ed030ac5 | |
| parent | e0ca6b1a314f949827fda499ee29dcbf6ef18acd (diff) | |
| download | rust-beadbfd19482ba9976092b193c102b17fb89137d.tar.gz rust-beadbfd19482ba9976092b193c102b17fb89137d.zip | |
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.
| -rw-r--r-- | src/libcollections/str.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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[..]) } |
