Skip to content

Rollup of 12 pull requests #84912

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

Closed
wants to merge 31 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8a2e67e
Simplify chdir implementation and minimize unsafe block
joshtriplett Apr 29, 2021
fe68b1a
Fix linker_args with --target=sparcv9-sun-solaris
iladin Apr 30, 2021
0b0d293
Report coverage `0` of dead blocks
richkadel May 1, 2021
3fca198
Move coverage tests from run-make-fulldeps to run-make
richkadel May 1, 2021
dd43d13
Reduce duplication in `impl_dep_tracking_hash` macros
jyn514 Apr 22, 2021
1e89b58
Account for unsatisfied bounds in E0599
estebank May 2, 2021
367c1db
:arrow_up: rust-analyzer
lnicola May 3, 2021
2e559c8
use `else if` in std library
wcampbell0x2a May 3, 2021
b4bfb0e
Update RELEASES.md for 1.52.0
XAMPPRocky Apr 14, 2021
03c763e
manually crafted revert of PR #80653, to address issue #82465.
pnkfelix May 3, 2021
86e3f76
regression test for issue 82465.
pnkfelix May 3, 2021
6eb4735
Unify rustc and rustdoc parsing of `cfg()`
jyn514 Apr 22, 2021
389333a
Update `ptr` docs with regards to `ptr::addr_of!`
jfrimmel Mar 27, 2021
450d121
Tests for field is never read diagnostic
sunjay Mar 11, 2021
67f228e
Added suggestion and note for when a field is never used
sunjay Mar 12, 2021
715a2d4
Updating test stderr files
sunjay Mar 12, 2021
d4c1ade
Trying out a new message that works a little better for values *and* …
sunjay Mar 12, 2021
bacfc34
New shorter diagnostic note that is different for items versus fields
sunjay Mar 13, 2021
0ba2c6a
Putting help message only under the identifier that needs to be prefixed
sunjay Mar 25, 2021
fee3b15
Rollup merge of #83004 - sunjay:field-never-read-issue-81658, r=pnkfelix
Dylan-DPC May 4, 2021
a1664a2
Rollup merge of #83553 - jfrimmel:addr-of, r=m-ou-se
Dylan-DPC May 4, 2021
c8c309c
Rollup merge of #84183 - rust-lang:relnotes-1.52.0, r=pietroalbini
Dylan-DPC May 4, 2021
3edfedc
Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkov
Dylan-DPC May 4, 2021
9a4d955
Rollup merge of #84468 - iladin:iladin/fix-84467, r=petrochenkov
Dylan-DPC May 4, 2021
63c3e88
Rollup merge of #84712 - joshtriplett:simplify-chdir, r=yaahc
Dylan-DPC May 4, 2021
899ea84
Rollup merge of #84797 - richkadel:cover-unreachable-statements, r=tm…
Dylan-DPC May 4, 2021
b2c0ce1
Rollup merge of #84803 - jyn514:duplicate-macros, r=petrochenkov
Dylan-DPC May 4, 2021
5bfedb4
Rollup merge of #84808 - estebank:issue-84769, r=petrochenkov
Dylan-DPC May 4, 2021
58d9c2c
Rollup merge of #84843 - wcampbell0x2a:use-else-if-let, r=dtolnay
Dylan-DPC May 4, 2021
69f2881
Rollup merge of #84851 - lnicola:rust-analyzer-2021-05-03, r=jonas-sc…
Dylan-DPC May 4, 2021
f1e26c4
Rollup merge of #84867 - pnkfelix:rustdoc-revert-deref-recur, r=jyn514
Dylan-DPC May 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions library/core/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,11 @@ impl Duration {
if let Some(mut secs) = self.secs.checked_sub(rhs.secs) {
let nanos = if self.nanos >= rhs.nanos {
self.nanos - rhs.nanos
} else if let Some(sub_secs) = secs.checked_sub(1) {
secs = sub_secs;
self.nanos + NANOS_PER_SEC - rhs.nanos
} else {
if let Some(sub_secs) = secs.checked_sub(1) {
secs = sub_secs;
self.nanos + NANOS_PER_SEC - rhs.nanos
} else {
return None;
}
return None;
};
debug_assert!(nanos < NANOS_PER_SEC);
Some(Duration { secs, nanos })
Expand Down