Skip to content

std: Fix the return value of Duration::span #18926

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 14, 2014

Conversation

alexcrichton
Copy link
Member

The subtraction was erroneously backwards, returning negative durations!

Closes #18925

@eddyb
Copy link
Member

eddyb commented Nov 13, 2014

I saw this today, after the new snapshot (I always compile with -Z time-passes).
What I found more weird is that the negative sign appears sepparately for the integer and fractional parts of the duration, e.g. time: -1.-1511 expansion.

@alexcrichton
Copy link
Member Author

Oh I think that's just my own personal mistake when printing durations. It should work ok if the duration is positive.

The subtraction was erroneously backwards, returning negative durations!

Closes rust-lang#18925
bors added a commit that referenced this pull request Nov 13, 2014
The subtraction was erroneously backwards, returning negative durations!

Closes #18925
@bors bors closed this Nov 14, 2014
@bors bors merged commit 8771394 into rust-lang:master Nov 14, 2014
@alexcrichton alexcrichton deleted the issue-18925 branch November 20, 2014 03:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std::time::duration::Duration::span() is backwards
4 participants