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
@ -123,6 +123,7 @@ fn mul(self, other: Wrapping<$t>) -> Wrapping<$t> {
|
||||
impl Not for Wrapping<$t> {
|
||||
type Output = Wrapping<$t>;
|
||||
|
||||
#[inline(always)]
|
||||
fn not(self) -> Wrapping<$t> {
|
||||
Wrapping(!self.0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user