rust/library/core/src/num
bors 7f3dc04644 Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
Make wrapping_neg() use wrapping_sub(), #[inline(always)]

This is a follow-up change to the fix for #75598. It simplifies the implementation of wrapping_neg() for all integer types by just calling 0.wrapping_sub(self) and always inlines it. This leads to much less assembly code being emitted for opt-level≤1 and thus much better performance for debug-compiled code.

Background is [this discussion on the internals forum](https://internals.rust-lang.org/t/why-does-rust-generate-10x-as-much-unoptimized-assembly-as-gcc/14930).
2021-08-04 12:58:31 +00:00
..
dec2flt Changed dec2flt to use the Eisel-Lemire algorithm. 2021-07-17 00:30:34 -05:00
flt2dec Changed dec2flt to use the Eisel-Lemire algorithm. 2021-07-17 00:30:34 -05:00
shells Convert the rest of the standard library primitives to intra-doc links 2021-02-25 20:32:49 -05:00
bignum.rs [clippy] remove redundant field names 2021-05-02 20:24:17 -04:00
diy_float.rs Fix assert in diy_float 2021-07-27 16:02:35 -04:00
error.rs postpone stabilizaton by one release 2021-06-22 10:20:56 +01:00
f32.rs Intra doc link-ify a reference to a function 2021-06-01 05:04:48 +02:00
f64.rs Intra doc link-ify a reference to a function 2021-06-01 05:04:48 +02:00
fmt.rs Move flt2dec::{Formatted, Part} to dedicated module 2021-06-06 02:54:51 +01:00
int_log10.rs special case for integer log10 2021-07-07 14:10:05 +02:00
int_macros.rs Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se 2021-08-04 12:58:31 +00:00
mod.rs Use .contains instead of manual reimplementation. 2021-08-03 04:30:44 -04:00
nonzero.rs Stop relying on #[feature(try_trait)] in doctests. 2021-06-12 10:58:37 +02:00
uint_macros.rs Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se 2021-08-04 12:58:31 +00:00
wrapping.rs add BITS associated constant to core::num::Wrapping 2021-05-11 13:36:43 +02:00