diff options
| author | bors <bors@rust-lang.org> | 2014-08-24 03:10:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-24 03:10:59 +0000 |
| commit | d0c314205c8820d7119465cc78eba14f17853c3b (patch) | |
| tree | e4d8d98edd1e1477802ffe27ca49147ddf56102f /src/rustllvm/RustWrapper.cpp | |
| parent | 904d88c2be3e99177745fc45870304e78d610e8c (diff) | |
| parent | b3b7c2e97b8e34ebc2597c21653df4b2d7a37575 (diff) | |
| download | rust-d0c314205c8820d7119465cc78eba14f17853c3b.tar.gz rust-d0c314205c8820d7119465cc78eba14f17853c3b.zip | |
auto merge of #16698 : bluss/rust/slice-bloat, r=huonw
These are somewhat stop-gap solutions to address #16625
core: Separate failure formatting in str methods slice, slice_to, slice_from
Use a separate inline-never function to format failure message for
str::slice() errors.
Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.
The testcase:
```
#![crate_type = "lib"]
pub fn slice(x: &str, a: uint, b: uint) -> &str {
x.slice(a, b)
}
```
shrinks from 16.9 kB to 3.3 kB llvm IR, and the number of `unreachable` drops from 5 to 1.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
