about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-07-29 18:03:55 -0600
committerGitHub <noreply@github.com>2017-07-29 18:03:55 -0600
commita3eadd767e7ab493a298a18a38baa64654dee8d3 (patch)
tree52518b546bef4587f199a3364e20fe3e2466559f /src/liballoc
parent5b85f650cf969940aa21cd257572e3621ed3f22a (diff)
parent54b6b23fc0e464110d8f4c6a6ab12aaeb7e2a198 (diff)
downloadrust-a3eadd767e7ab493a298a18a38baa64654dee8d3.tar.gz
rust-a3eadd767e7ab493a298a18a38baa64654dee8d3.zip
Rollup merge of #43513 - alexcrichton:inline-repeat, r=BurntSushi
std: Mark `Layout::repeat` as `#[inline]`

This fixes an optimization regression by allowing LLVM to see through more
functions.

Closes #43272
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/allocator.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liballoc/allocator.rs b/src/liballoc/allocator.rs
index 66e0bf81c90..42111301a9f 100644
--- a/src/liballoc/allocator.rs
+++ b/src/liballoc/allocator.rs
@@ -215,6 +215,7 @@ impl Layout {
     /// of each element in the array.
     ///
     /// On arithmetic overflow, returns `None`.
+    #[inline]
     pub fn repeat(&self, n: usize) -> Option<(Self, usize)> {
         let padded_size = match self.size.checked_add(self.padding_needed_for(self.align)) {
             None => return None,