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

sys::unix::time.rs has spelling error in Instant::sub_duration #41514

Closed
krampenschiesser opened this issue Apr 24, 2017 · 0 comments
Closed
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools

Comments

@krampenschiesser
Copy link

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
tbu- added a commit to tbu-/rust that referenced this issue Apr 24, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 25, 2017
Fix a copy-paste error in `Instant::sub_duration`

Fixes rust-lang#41514.
@frewsxcv frewsxcv added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Apr 25, 2017
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 25, 2017
Fix a copy-paste error in `Instant::sub_duration`

Fixes rust-lang#41514.
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 25, 2017
Fix a copy-paste error in `Instant::sub_duration`

Fixes rust-lang#41514.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 26, 2017
Fix a copy-paste error in `Instant::sub_duration`

Fixes rust-lang#41514.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

No branches or pull requests

2 participants