-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Description
I was subtracting a duration from an instant and on travis/macos this fails with the following message:
overflow when adding duration to instant
This is a copy&paste/spelling error because I am using sub:
Current code in sys::unix::time.rs (sys::windows is correct):
pub fn sub_duration(&self, other: &Duration) -> Instant {
Instant {
t: self.t.checked_sub(dur2intervals(other))
.expect("overflow when adding duration to instant"),
}
}
Should be
pub fn sub_duration(&self, other: &Duration) -> Instant {
Instant {
t: self.t.checked_sub(dur2intervals(other))
.expect("overflow when subtracting duration from time"),
}
}
Meta
rustc --version --verbose
:
rustc 1.18.0-nightly (252d3da8a 2017-04-22)
binary: rustc
commit-hash: 252d3da8a6c715ccafcf77d83b826f6fb899cfe5
commit-date: 2017-04-22
host: x86_64-unknown-linux-gnu
release: 1.18.0-nightly
LLVM version: 3.9
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools