diff options
| author | Ralf Jung <post@ralfj.de> | 2020-06-06 21:57:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-06 21:57:33 +0200 |
| commit | 64c27f9fee17cf666c31dfdc6161ad0666311cdd (patch) | |
| tree | 4f13c495e95ed31c7e27672a7f636f10ec18c9d3 /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs | |
| parent | 118b50524b79e565f017e08bce9b90a16c63634f (diff) | |
| parent | 58ae4a9a5388d9c2c5e4ac435ea69a2b456ab008 (diff) | |
| download | rust-64c27f9fee17cf666c31dfdc6161ad0666311cdd.tar.gz rust-64c27f9fee17cf666c31dfdc6161ad0666311cdd.zip | |
Rollup merge of #71796 - RalfJung:from-secs, r=nikomatsakis
de-promote Duration::from_secs In https://github.com/rust-lang/rust/pull/67531, we removed the `rustc_promotable` attribute from a bunch of `Duration` methods, but not from `Duration::from_secs`. This makes the current list of promotable functions the following (courtesy of @ecstatic-morse): * `INT::min_value`, `INT::max_value` * `std::mem::size_of`, `std::mem::align_of` * `RangeInclusive::new` (backing `x..=y`) * `std::ptr::null`, `std::ptr::null_mut` * `RawWaker::new`, `RawWakerVTable::new` ??? * `Duration::from_secs` I feel like the last one stands out a bit here -- the rest are all very core language primitives, and `RawWaker` has a strong motivation for getting a `'static` vtable. But a `&'static Duration`? That seems unlikely. So I propose we no longer promote calls to `Duration::from_secs`, which is what this PR does. https://github.com/rust-lang/rust/pull/67531 saw zero regressions and I am not aware of anyone complaining that this broke their (non-cratered) code, so I consider it likely the same will be true here, but of course we'd do a crater run. See [this document](https://github.com/rust-lang/const-eval/blob/master/promotion.md) for some more background on promotion and https://github.com/rust-lang/const-eval/issues/19 for some of the concerns around promoting function calls.
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs')
0 files changed, 0 insertions, 0 deletions
