Skip to content

Commit 662bf71

Browse files
committed
Auto merge of #67531 - RalfJung:tame-promotion, r=<try>
WIP: 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
2 parents 0d2817a + 368ac73 commit 662bf71

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/libcore/time.rs

-3
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ impl Duration {
172172
/// ```
173173
#[stable(feature = "duration", since = "1.3.0")]
174174
#[inline]
175-
#[rustc_promotable]
176175
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
177176
pub const fn from_millis(millis: u64) -> Duration {
178177
Duration {
@@ -195,7 +194,6 @@ impl Duration {
195194
/// ```
196195
#[stable(feature = "duration_from_micros", since = "1.27.0")]
197196
#[inline]
198-
#[rustc_promotable]
199197
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
200198
pub const fn from_micros(micros: u64) -> Duration {
201199
Duration {
@@ -218,7 +216,6 @@ impl Duration {
218216
/// ```
219217
#[stable(feature = "duration_extras", since = "1.27.0")]
220218
#[inline]
221-
#[rustc_promotable]
222219
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
223220
pub const fn from_nanos(nanos: u64) -> Duration {
224221
Duration {

0 commit comments

Comments
 (0)