Uh oh!
There was an error while loading. Please reload this page.
Stabilize integer logarithms - #103570
Conversation
| /// | ||
| /// This function will panic if `self` is less than or equal to zero, | ||
| /// or if `base` is less then 2. | ||
| /// or if `base` is less than 2. |
scottmcm
commented
Oct 28, 2022
Good news -- that's no longer needed! The magic constant does the right thing, regardless of when this finally ends up landing. |
yoshuawuyts
commented
Oct 31, 2022
@scottmcm oh amazing - love to see it! |
rustbot
commented
Nov 3, 2022
The Miri subtree was changed cc @rust-lang/miri Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
| #[unstable(feature = "int_log", issue = "70887")] | ||
| #[stable(feature = "int_log", since = "CURRENT_RUSTC_VERSION")] | ||
| #[rustc_const_stable(feature = "int_log", since = "CURRENT_RUSTC_VERSION")] | ||
| #[rustc_allow_const_fn_unstable(const_option)] |
There was a problem hiding this comment.
Cc @rust-lang/wg-const-eval do we already have rustc_allow_const_fn_unstable(const_option) for Option::expect?
There was a problem hiding this comment.
No, but it seems entirely fine, as worst case we remove it and use manual match at the call sites
scottmcm
commented
Nov 9, 2022
With the FCP complete, this looks good to go! 🎉 @bors r+ |
bors
commented
Nov 9, 2022
Stabilize integer logarithms Stabilizes feature `int_log`. I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc `@rust-lang/wg-const-eval` closesrust-lang#70887 (tracking issue) ~~blocked on FCP finishing: rust-lang#70887 (comment) FCP finished: rust-lang#70887 (comment)
Rollup of 7 pull requests Successful merges: - rust-lang#103570 (Stabilize integer logarithms) - rust-lang#103694 (Add documentation examples for `pointer::mask`) - rust-lang#103919 (Unescaping cleanups) - rust-lang#103933 (Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2) - rust-lang#103952 (Don't intra linkcheck reference) - rust-lang#104111 (rustdoc: Add mutable to the description) - rust-lang#104125 (Const Compare for Tuples) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Stabilize integer logarithms Stabilizes feature `int_log`. I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc ```@rust-lang/wg-const-eval``` closesrust-lang#70887 (tracking issue) ~~blocked on FCP finishing: rust-lang#70887 (comment) FCP finished: rust-lang#70887 (comment)
Stabilize integer logarithms Stabilizes feature `int_log`. I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc ``@rust-lang/wg-const-eval`` closesrust-lang#70887 (tracking issue) ~~blocked on FCP finishing: rust-lang#70887 (comment) FCP finished: rust-lang#70887 (comment)
Rollup of 7 pull requests Successful merges: - rust-lang#103570 (Stabilize integer logarithms) - rust-lang#103694 (Add documentation examples for `pointer::mask`) - rust-lang#103919 (Unescaping cleanups) - rust-lang#103933 (Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2) - rust-lang#103952 (Don't intra linkcheck reference) - rust-lang#104111 (rustdoc: Add mutable to the description) - rust-lang#104125 (Const Compare for Tuples) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Stabilizes feature
int_log.I've also made the functions const stable, because they don't depend on any unstable const features.
rustc_allow_const_fn_unstableis just there forOption::expect, which could be replaced with amatchandpanic!. cc @rust-lang/wg-const-evalcloses#70887 (tracking issue)
blocked on FCP finishing: #70887 (comment)FCP finished: #70887 (comment)