Uh oh!
There was an error while loading. Please reload this page.
Make time::Instant::actually_monotonic() a const fn. - #65954
Conversation
rust-highfive
commented
Oct 30, 2019
r? @kennytm (rust_highfive has picked a reviewer for you, use r? to override) |
kennytm
commented
Oct 30, 2019
Could you provide any context why this is needed? AFAIK |
This PR mainly prevents anyone from accidentally adding code which introduces runtime penalty to
note: AFAIK monotonicity only depends on platform and build configurations and won't change at runtime. |
Compile-time evaluation does not happen when constfnfoo() -> bool{true}pubfnbar() -> bool{foo()}; playground::foo; Function Attrs: nonlazybind uwtabledefineinternalzeroexti1@_ZN10playground3foo17h3b9711775736012fE() unnamed_addr #0!dbg!5 {
start:
reti1true, !dbg!10
}
; playground::bar; Function Attrs: nonlazybind uwtabledefinezeroexti1@_ZN10playground3bar17hfc942ebdcf035a2cE() unnamed_addr #0!dbg!11 {
start:
; call playground::foo%0 = callzeroexti1@_ZN10playground3foo17h3b9711775736012fE(), !dbg!12brlabel%bb1, !dbg!12
bb1: ; preds = %startreti1%0, !dbg!13
}EDIT: Also, |
shamiao
commented
Oct 30, 2019
@sinkuu Sorry, this is my mistake. But I wonder why the compiler doesn't evaluate it? |
sinkuu
commented
Oct 30, 2019
@shamiao |
joelpalmer
commented
Nov 4, 2019
Ping from Triage: Any updates @shamiao |
shamiao
commented
Nov 4, 2019
@joelpalmer I have no further updates. Waiting the Rust crew to decide whether this PR should be merged. |
JohnCSimon
commented
Nov 9, 2019
kennytm
commented
Nov 9, 2019
IMO the reason making this a
So I'd prefer to close this PR. |
shamiao
commented
Nov 9, 2019
@kennytm Opinion 3 seems compelling to me. I'll close this PR. |
No description provided.