We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa83235 commit d0fb350Copy full SHA for d0fb350
src/tools/miri/src/clock.rs
@@ -40,6 +40,8 @@ impl Instant {
40
InstantKind::Virtual { nanoseconds: earlier },
41
) => {
42
let duration = nanoseconds.saturating_sub(earlier);
43
+ // `Duration` does not provide a nice constructor from a `u128` of nanoseconds,
44
+ // so we have to implement this ourselves.
45
// It is possible for second to overflow because u64::MAX < (u128::MAX / 1e9).
46
let seconds = u64::try_from(duration.saturating_div(1_000_000_000)).unwrap();
47
// It is impossible for nanosecond to overflow because u32::MAX > 1e9.
0 commit comments