Closed
Description
(none exhaustive) list of libcore::num
, which should be a const fn
:
feature = const_int_rotate
rotate_left
Add more const int ops #53697 -- stabilizedrotate_right
Add more const int ops #53697 -- stabilized
feature = const_checked_int_methods
checked_add
[1] Make more arithmetic functions unstably const #68809checked_sub
[1] Make more arithmetic functions unstably const #68809checked_mul
[1] Make more arithmetic functions unstably const #68809checked_div
[1] Make more arithmetic functions unstably const #68809checked_rem
[1] Make more arithmetic functions unstably const #68809checked_neg
[1] Make more arithmetic functions unstably const #68809checked_shl
[1] Make more arithmetic functions unstably const #68809checked_shr
[1] Make more arithmetic functions unstably const #68809checked_abs
[1] Make more arithmetic functions unstably const #68809
feature = const_saturating_int_methods
saturating_mul
[1] Make more arithmetic functions unstably const #68809
feature = const_int_wrapping
wrapping_add
Add more const int ops #53697 -- stabilizedwrapping_sub
Add more const int ops #53697 -- stabilizedwrapping_mul
Add more const int ops #53697 -- stabilizedwrapping_div
[1] Make more arithmetic functions unstably const #68809wrapping_rem
[1] Make more arithmetic functions unstably const #68809wrapping_neg
Make overflowing and wrapping negation const #58044 -- stabilizedwrapping_shl
Add more const int ops #53697 -- stabilizedwrapping_shr
Add more const int ops #53697 -- stabilizedwrapping_abs
Makeabs
,wrapping_abs
,overflowing_abs
const functions #63786 -- stabilized in 1.39
feature = const_int_overflowing
overflowing_add
Add more const int ops #53697overflowing_sub
Add more const int ops #53697overflowing_mul
Add more const int ops #53697overflowing_div
[1] Make more arithmetic functions unstably const #68809overflowing_rem
[1] Make more arithmetic functions unstably const #68809overflowing_neg
Make overflowing and wrapping negation const #58044 -- stabilizedoverflowing_shl
Add more const int ops #53697overflowing_shr
Add more const int ops #53697overflowing_abs
Makeabs
,wrapping_abs
,overflowing_abs
const functions #63786 -- stabilized in 1.39
feature = const_euclidean_int_methods
checked_div_euc
[1] Make more arithmetic functions unstably const #68809checked_mod_euc
[1] Make more arithmetic functions unstably const #68809wrapping_div_euc
[1] Make more arithmetic functions unstably const #68809wrapping_mod_euc
[1] Make more arithmetic functions unstably const #68809overflowing_div_euc
[1] Make more arithmetic functions unstably const #68809overflowing_mod_euc
[1] Make more arithmetic functions unstably const #68809
feature = const_int_pow
is_power_of_two
make is_power_of_two a const function #65092next_power_of_two
[1] Make integer exponentiation methods unstably const #68978checked_pow
[1] Make integer exponentiation methods unstably const #68978checked_next_power_of_two
[1] Make integer exponentiation methods unstably const #68978saturating_pow
[1, 2] Make integer exponentiation methods unstably const #68978wrapping_pow
[1, 2] Make integer exponentiation methods unstably const #68978wrapping_next_power_of_two
[1] Make integer exponentiation methods unstably const #68978overflowing_pow
[1, 2] Make integer exponentiation methods unstably const #68978
feature = const_int_sign
abs
Makeabs
,wrapping_abs
,overflowing_abs
const functions #63786 -- stabilized in 1.39is_positive
Add more const int ops #53697 -- stabilizedis_negative
Add more const int ops #53697 -- stabilized
feature = const_int_conversion
to_be_bytes
Add more const int ops #53697to_le_bytes
Add more const int ops #53697to_ne_bytes
Add more const int ops #53697from_be_bytes
Add more const int ops #53697from_le_bytes
Add more const int ops #53697from_ne_bytes
Add more const int ops #53697reverse_bits
Add more const int ops #53697
feature = const_nonzero_int_methods
NonZero*::new
[1] Makenum::NonZeroX::new
an unstableconst fn
#68976
- Requires conditionals. Tracking Issue: Tracking issue for RFC 2342, "Allow
if
andmatch
in constants" #49146 (implemented on nightly) - Requires loops. Tracking Issue: Tracking issue for RFC 2344, "Allow
loop
in constant evaluation" #52000 (implemented on nightly)
This issue has been assigned to @9999years via this comment.
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Relevant to the language teamRelevant to the library API team, which will review and decide on the PR/issue.
Activity
TheDarkula commentedon Aug 30, 2018
transmute()
just got merged. You can start on your last block now :)TimDiekmann commentedon Aug 31, 2018
@TheDarkula Thank you, I'll start implementing them as soon as #53699 is merged.
TimDiekmann commentedon Aug 31, 2018
Added rest of
const_int_conversion
to #53697TimDiekmann commentedon Sep 1, 2018
I'm currently rebasing #53697 and testing. Then the first bunch should be ready to merge.
Auto merge of #53697 - Cyres:const-fn-int-ops, r=oli-obk
mjbshaw commentedon Dec 31, 2018
Adding a comment here so I don't have to hunt for the following related issue: #51267 is the tracking issue for
feature = const_int_ops
, which tracks:count_zeros
-- stabilizedcount_ones
-- stabilizedleading_zeros
-- stabilizedtrailing_zeros
-- stabilizedconst fn
#57563Lokathor commentedon Jan 13, 2019
wrapping_neg isn't on the list here it seems (though overflowing_neg is)
67 remaining items