diff options
| author | bors <bors@rust-lang.org> | 2015-05-09 03:55:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-05-09 03:55:27 +0000 |
| commit | 50aada70f4bcd507cc73a7eabe5206f85dd377a4 (patch) | |
| tree | cb0ff78d03b1f9b00ffe8aee82445d55d515a82b /src | |
| parent | 8c9dc18355f430466891aaad257fe05279358657 (diff) | |
| parent | 48636f3179990712b5b9da1633e5c1f6c570425b (diff) | |
| download | rust-50aada70f4bcd507cc73a7eabe5206f85dd377a4.tar.gz rust-50aada70f4bcd507cc73a7eabe5206f85dd377a4.zip | |
Auto merge of #25159 - inrustwetrust:wrapping_inline, r=alexcrichton
This was causing function calls to be emitted for bitwise complements, even with optimizations on.
Steps to reproduce:
```
$ cat wrapping.rs
fn main() {
let a = std::num::Wrapping(std::env::args().len() as u32);
let b = !a;
println!("{}", b.0);
}
$ rustc -O wrapping.rs --emit=asm,link
$ grep Not wrapping.s
callq _ZN3num8wrapping23Wrapping$LT$u32$GT$.Not3not20hba4b266232e02b1dHkbE
```
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/num/wrapping.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index b7ca497db18..69c22229490 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -123,6 +123,7 @@ macro_rules! wrapping_impl { impl Not for Wrapping<$t> { type Output = Wrapping<$t>; + #[inline(always)] fn not(self) -> Wrapping<$t> { Wrapping(!self.0) } |
