Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all methods of Duration unstably const #76335

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

CDirkx
Copy link
Contributor

@CDirkx CDirkx commented Sep 4, 2020

Make the following methods of Duration unstable const under duration_const_2:

  • from_secs_f64
  • from_secs_f32
  • mul_f64
  • mul_f32
  • div_f64
  • div_f32

This results in all methods of Duration being (unstable) const.

Moved the tests to library as part of #76268.

Possible because of #72449, which made the relevant f32 and f64 methods const.

Tracking issue: #72440

r? @ecstatic-morse

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 4, 2020
@marmeladema
Copy link
Contributor

Thanks! I wanted do to that but got side tracked.

@jyn514 jyn514 added A-const-fn T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-testsuite Area: The testsuite used to check the correctness of rustc labels Sep 5, 2020
@jyn514 jyn514 changed the title Make all methods of Duration const Make all methods of Duration unstably const Sep 5, 2020
@bors
Copy link
Contributor

bors commented Sep 12, 2020

☔ The latest upstream changes (presumably #76637) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

Make the following methods of `Duration` unstable const under `duration_const_2`:
 - `from_secs_f64`
 - `from_secs_f32`
 - `mul_f64`
 - `mul_f32`
 - `div_f64`
 - `div_f32`

This results in all methods of `Duration` being (unstable) const.

Also adds tests for these methods in a const context, moved the test to `library` as part of rust-lang#76268.

Possible because of rust-lang#72449, which made the relevant `f32` and `f64` methods const.

Tracking issue: rust-lang#72440
@CDirkx
Copy link
Contributor Author

CDirkx commented Sep 12, 2020

Rebased onto master.
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@ecstatic-morse
Copy link
Contributor

Sorry @CDirkx, this one slipped through the cracks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 12, 2020

📌 Commit 73e0a56 has been approved by ecstatic-morse

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 12, 2020
…orse

Make all methods of `Duration` unstably const

Make the following methods of `Duration` unstable const under `duration_const_2`:
 - `from_secs_f64`
 - `from_secs_f32`
 - `mul_f64`
 - `mul_f32`
 - `div_f64`
 - `div_f32`

This results in all methods of `Duration` being (unstable) const.

Moved the tests to `library` as part of rust-lang#76268.

Possible because of rust-lang#72449, which made the relevant `f32` and `f64` methods const.

Tracking issue: rust-lang#72440

r? @ecstatic-morse
RalfJung added a commit to RalfJung/rust that referenced this pull request Sep 13, 2020
…orse

Make all methods of `Duration` unstably const

Make the following methods of `Duration` unstable const under `duration_const_2`:
 - `from_secs_f64`
 - `from_secs_f32`
 - `mul_f64`
 - `mul_f32`
 - `div_f64`
 - `div_f32`

This results in all methods of `Duration` being (unstable) const.

Moved the tests to `library` as part of rust-lang#76268.

Possible because of rust-lang#72449, which made the relevant `f32` and `f64` methods const.

Tracking issue: rust-lang#72440

r? @ecstatic-morse
RalfJung added a commit to RalfJung/rust that referenced this pull request Sep 13, 2020
…orse

Make all methods of `Duration` unstably const

Make the following methods of `Duration` unstable const under `duration_const_2`:
 - `from_secs_f64`
 - `from_secs_f32`
 - `mul_f64`
 - `mul_f32`
 - `div_f64`
 - `div_f32`

This results in all methods of `Duration` being (unstable) const.

Moved the tests to `library` as part of rust-lang#76268.

Possible because of rust-lang#72449, which made the relevant `f32` and `f64` methods const.

Tracking issue: rust-lang#72440

r? @ecstatic-morse
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 16, 2020
…orse

Make all methods of `Duration` unstably const

Make the following methods of `Duration` unstable const under `duration_const_2`:
 - `from_secs_f64`
 - `from_secs_f32`
 - `mul_f64`
 - `mul_f32`
 - `div_f64`
 - `div_f32`

This results in all methods of `Duration` being (unstable) const.

Moved the tests to `library` as part of rust-lang#76268.

Possible because of rust-lang#72449, which made the relevant `f32` and `f64` methods const.

Tracking issue: rust-lang#72440

r? @ecstatic-morse
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#76056 (Add more info for Vec Drain doc)
 - rust-lang#76062 (Vec slice example fix style and show type elision)
 - rust-lang#76262 (Use inline(never) instead of cold)
 - rust-lang#76335 (Make all methods of `Duration` unstably const)
 - rust-lang#76366 (Add Arith Tests in Library)
 - rust-lang#76369 (Move Various str tests in library)
 - rust-lang#76534 (Add doc comments for From impls)
 - rust-lang#76622 (Update bootstrap readme)
 - rust-lang#76641 (Some cleanup changes and commenting)
 - rust-lang#76662 (Fix liballoc test suite for Miri)

Failed merges:

r? `@ghost`
@bors bors merged commit 22dd07d into rust-lang:master Sep 16, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 16, 2020
@CDirkx CDirkx deleted the const-duration branch October 17, 2020 13:39
@RalfJung RalfJung added the A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants