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 -- stabilized -
rotate_right
Add more const int ops #53697 -- stabilized
-
feature = const_checked_int_methods
-
checked_add
[1] Make more arithmetic functions unstably const #68809 -
checked_sub
[1] Make more arithmetic functions unstably const #68809 -
checked_mul
[1] Make more arithmetic functions unstably const #68809 -
checked_div
[1] Make more arithmetic functions unstably const #68809 -
checked_rem
[1] Make more arithmetic functions unstably const #68809 -
checked_neg
[1] Make more arithmetic functions unstably const #68809 -
checked_shl
[1] Make more arithmetic functions unstably const #68809 -
checked_shr
[1] Make more arithmetic functions unstably const #68809 -
checked_abs
[1] Make more arithmetic functions unstably const #68809
-
feature = const_saturating_int_methods
-
saturating_add
Makesaturating_add
andsaturating_sub
const
functions #58246 -
saturating_sub
Makesaturating_add
andsaturating_sub
const
functions #58246 -
saturating_mul
[1] Make more arithmetic functions unstably const #68809
-
feature = const_int_wrapping
-
wrapping_add
Add more const int ops #53697 -- stabilized -
wrapping_sub
Add more const int ops #53697 -- stabilized -
wrapping_mul
Add more const int ops #53697 -- stabilized -
wrapping_div
[1] Make more arithmetic functions unstably const #68809 -
wrapping_rem
[1] Make more arithmetic functions unstably const #68809 -
wrapping_neg
Make overflowing and wrapping negation const #58044 -- stabilized -
wrapping_shl
Add more const int ops #53697 -- stabilized -
wrapping_shr
Add more const int ops #53697 -- stabilized -
wrapping_abs
Makeabs
,wrapping_abs
,overflowing_abs
const functions #63786 -- stabilized in 1.39
-
feature = const_int_overflowing
-
overflowing_add
Add more const int ops #53697 -
overflowing_sub
Add more const int ops #53697 -
overflowing_mul
Add more const int ops #53697 -
overflowing_div
[1] Make more arithmetic functions unstably const #68809 -
overflowing_rem
[1] Make more arithmetic functions unstably const #68809 -
overflowing_neg
Make overflowing and wrapping negation const #58044 -- stabilized -
overflowing_shl
Add more const int ops #53697 -
overflowing_shr
Add more const int ops #53697 -
overflowing_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 #68809 -
checked_mod_euc
[1] Make more arithmetic functions unstably const #68809 -
wrapping_div_euc
[1] Make more arithmetic functions unstably const #68809 -
wrapping_mod_euc
[1] Make more arithmetic functions unstably const #68809 -
overflowing_div_euc
[1] Make more arithmetic functions unstably const #68809 -
overflowing_mod_euc
[1] Make more arithmetic functions unstably const #68809
-
feature = const_int_pow
-
pow
[1, 2] Make integer exponentiation methods unstably const #68978 -
is_power_of_two
make is_power_of_two a const function #65092 -
next_power_of_two
[1] Make integer exponentiation methods unstably const #68978 -
checked_pow
[1] Make integer exponentiation methods unstably const #68978 -
checked_next_power_of_two
[1] Make integer exponentiation methods unstably const #68978 -
saturating_pow
[1, 2] Make integer exponentiation methods unstably const #68978 -
wrapping_pow
[1, 2] Make integer exponentiation methods unstably const #68978 -
wrapping_next_power_of_two
[1] Make integer exponentiation methods unstably const #68978 -
overflowing_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.39 -
signum
Makei*::signum
aconst fn
. #61635 -
is_positive
Add more const int ops #53697 -- stabilized -
is_negative
Add more const int ops #53697 -- stabilized
-
feature = const_int_conversion
-
to_be_bytes
Add more const int ops #53697 -
to_le_bytes
Add more const int ops #53697 -
to_ne_bytes
Add more const int ops #53697 -
from_be_bytes
Add more const int ops #53697 -
from_le_bytes
Add more const int ops #53697 -
from_ne_bytes
Add more const int ops #53697 -
reverse_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 team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.