Skip to content

Commit

Permalink
Rollup merge of rust-lang#67531 - RalfJung:tame-promotion, r=nikomats…
Browse files Browse the repository at this point in the history
…akis

no longer promote non-pattern const functions

This is trying to pack-pedal a bit on promotion feature creep, as proposed by @eddyb [here](rust-lang/const-eval#19 (comment)): possibly, a sane subset of `const fn` that we could promote are those that are just constructors -- the same subset that we might want to allow in pattern position at some point.

So, this removes the `rustc_promotable` attribute from the three functions they identified that do not fit this pattern. The first step is to run crater to see if there is code in the wild that relies on this being promotable.

r? @oli-obk
  • Loading branch information
Centril authored Jan 3, 2020
2 parents d0fe179 + 368ac73 commit 10f153f
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/libcore/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ impl Duration {
/// ```
#[stable(feature = "duration", since = "1.3.0")]
#[inline]
#[rustc_promotable]
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
pub const fn from_millis(millis: u64) -> Duration {
Duration {
Expand All @@ -195,7 +194,6 @@ impl Duration {
/// ```
#[stable(feature = "duration_from_micros", since = "1.27.0")]
#[inline]
#[rustc_promotable]
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
pub const fn from_micros(micros: u64) -> Duration {
Duration {
Expand All @@ -218,7 +216,6 @@ impl Duration {
/// ```
#[stable(feature = "duration_extras", since = "1.27.0")]
#[inline]
#[rustc_promotable]
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
pub const fn from_nanos(nanos: u64) -> Duration {
Duration {
Expand Down

0 comments on commit 10f153f

Please sign in to comment.