test: Fix an overflow on empty benchmarks #23127

Merged
merged 1 commit into from Mar 8, 2015

Conversation

Projects
None yet
5 participants
@alexcrichton
Member

alexcrichton commented Mar 6, 2015

Right now the rust upgrade in cargo is blocked on fixing this overflow. If a
this benchmark is run it will trigger an overflow error today:

#[bench]
fn foo(b: &mut test::Bencher) {}

This commit adds a check on each iteration of the loop that the maximum
multiplier (10) doesn't overflow, and if it does just return the results so far.

@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Mar 6, 2015

Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

Collaborator

rust-highfive commented Mar 6, 2015

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
Member

alexcrichton commented Mar 6, 2015

test: Fix an overflow on empty benchmarks
Right now the rust upgrade in cargo is blocked on fixing this overflow. If a
this benchmark is run it will trigger an overflow error today:

    #[bench]
    fn foo(b: &mut test::Bencher) {}

This commit adds a check on each iteration of the loop that the maximum
multiplier (10) doesn't overflow, and if it does just return the results so far.
@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson Mar 8, 2015

Contributor

@bors: r+

Contributor

brson commented Mar 8, 2015

@bors: r+

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Mar 8, 2015

Contributor

@bors r=brson 946a396

Contributor

bors commented Mar 8, 2015

@bors r=brson 946a396

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Mar 8, 2015

Contributor

⌛️ Testing commit 946a396 with merge b2f09c1...

Contributor

bors commented Mar 8, 2015

⌛️ Testing commit 946a396 with merge b2f09c1...

bors added a commit that referenced this pull request Mar 8, 2015

Auto merge of #23127 - alexcrichton:bench-wrapping, r=brson
Right now the rust upgrade in cargo is blocked on fixing this overflow. If a
this benchmark is run it will trigger an overflow error today:

    #[bench]
    fn foo(b: &mut test::Bencher) {}

This commit adds a check on each iteration of the loop that the maximum
multiplier (10) doesn't overflow, and if it does just return the results so far.

@bors bors merged commit 946a396 into rust-lang:master Mar 8, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@pnkfelix pnkfelix referenced this pull request in pnkfelix/collab-docs Mar 8, 2015

Closed

Overflow in empty benchmarks #2

@alexcrichton alexcrichton deleted the alexcrichton:bench-wrapping branch Mar 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment