diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-10-18 13:48:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-18 13:48:10 -0700 |
| commit | 7167a592414875bfa01e9e37ff2b905086a2761a (patch) | |
| tree | c785967280518a4129e1fff8d680089ddfd82834 | |
| parent | 518deda77feb4957bfd311b6cb50baa7ef9ca6a2 (diff) | |
| parent | a87b44dbea5335c9b5d563b44e0e5f8b074ac9db (diff) | |
| download | rust-7167a592414875bfa01e9e37ff2b905086a2761a.tar.gz rust-7167a592414875bfa01e9e37ff2b905086a2761a.zip | |
Rollup merge of #65016 - lzutao:inline-mem-constfn, r=oli-obk
Always inline `mem::{size_of,align_of}` in debug builds
Those two are const fn and do not have any arguments. Inlining
helps reducing generated code size in debug builds.
See also #64996.
| -rw-r--r-- | src/libcore/mem/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index 23608931b1d..c7da56aad30 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -236,7 +236,7 @@ pub fn forget_unsized<T: ?Sized>(t: T) { /// ``` /// /// [alignment]: ./fn.align_of.html -#[inline] +#[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] pub const fn size_of<T>() -> usize { @@ -328,7 +328,7 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize { /// /// assert_eq!(4, mem::align_of::<i32>()); /// ``` -#[inline] +#[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] pub const fn align_of<T>() -> usize { |
