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
```
This commit is contained in:
commit
50aada70f4
1 changed files with 1 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue