rust/library/core/src/num
Matthias Krüger 260e07b0cb
Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomcc
Clean up unchecked_math, separate out unchecked_shifts

Tracking issue: #85122

Changes:

1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised.
2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result.
3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO.

The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-11-01 11:29:41 +01:00
..
dec2flt explain why we can mutate the FPU control word 2023-08-14 16:10:56 +02:00
flt2dec Add shortcut for Grisu3 algorithm. 2023-04-25 11:34:57 +08:00
shells Fix wrong type in docs: i16 -> u16 2023-04-07 23:49:20 +02:00
bignum.rs Rename integer log* methods to ilog* 2022-08-09 10:20:49 -07:00
diy_float.rs Fix assert in diy_float 2021-07-27 16:02:35 -04:00
error.rs Add #[inline] to functions that are never called 2023-05-07 12:41:37 +01:00
f32.rs Auto merge of #114042 - liushuyu:ubuntu/i586-fpmath, r=workingjubilee 2023-10-05 13:35:18 +00:00
f64.rs Auto merge of #104153 - tspiteri:doc-float-constants, r=workingjubilee 2023-10-05 11:46:55 +00:00
fmt.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
int_log10.rs Have a function for the log(0) panic, rather than copy-pasting the string constant 2023-02-10 12:50:17 -08:00
int_macros.rs Clean up unchecked_math, separate out unchecked_shifts 2023-10-13 02:17:08 -04:00
mod.rs Refactor some char, u8 ascii functions to be branchless 2023-10-26 21:48:36 -04:00
nonzero.rs Add alignment to the NPO guarantee 2023-08-15 02:37:34 -07:00
saturating.rs Bump to latest beta 2023-10-08 19:57:43 -04:00
uint_macros.rs Clean up unchecked_math, separate out unchecked_shifts 2023-10-13 02:17:08 -04:00
wrapping.rs [clippy] Use symbols intended for arithmetic_side_effects 2023-09-01 10:28:55 +02:00