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

Test Duration::new panics on overflow #69354

Merged
merged 1 commit into from
Feb 22, 2020

Conversation

MichaelMcDonnell
Copy link
Contributor

A Duration is created from a second and nanoseconds variable. The
documentation says: "This constructor will panic if the carry from the
nanoseconds overflows the seconds counter". This was, however, not tested
in the tests. I doubt the behavior will ever regress, but it is usually a
good idea to test all documented behavior.

A `Duration` is created from a second and nanoseconds variable. The
documentation says: "This constructor will panic if the carry from the
nanoseconds overflows the seconds counter". This was, however, not tested
in the tests. I doubt the behavior will ever regress, but it is usually a
good idea to test all documented behavior.
@Centril
Copy link
Contributor

Centril commented Feb 21, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Feb 21, 2020

📌 Commit e1c8c8c has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 21, 2020
@Centril
Copy link
Contributor

Centril commented Feb 21, 2020

r? @Centril

bors added a commit that referenced this pull request Feb 22, 2020
Rollup of 7 pull requests

Successful merges:

 - #68984 (Make `u8::is_ascii` a stable `const fn`)
 - #69339 (Add test for #69312)
 - #69346 (Clean up E0323, E0324, E0325 and E0326 explanations)
 - #69348 (Wrong error message for move_ref_pattern)
 - #69349 (MIR is not an experiment anymore)
 - #69354 (Test `Duration::new` panics on overflow)
 - #69370 (move const_eval.rs into the module folder)

Failed merges:

r? @ghost
@bors bors merged commit 4f71270 into rust-lang:master Feb 22, 2020
@MichaelMcDonnell MichaelMcDonnell deleted the duration_overflow_test branch February 22, 2020 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants