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

incr: Update hash tests to use `except`-style checking #45951

Merged
merged 6 commits into from Nov 16, 2017

Conversation

Projects
None yet
4 participants
@CrockAgile
Copy link
Contributor

CrockAgile commented Nov 13, 2017

CrockAgile added some commits Nov 12, 2017

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Nov 13, 2017

Thanks a lot, @CrockAgile! Quite a few check boxes to tick off :)

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 13, 2017

📌 Commit 6424688 has been approved by michaelwoerister

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Nov 13, 2017

@bors rollup

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 14, 2017

Rollup merge of rust-lang#45951 - CrockAgile:master, r=michaelwoerister
incr: Update hash tests to use `except`-style checking

Part of rust-lang#44924

r? @michaelwoerister

bors added a commit that referenced this pull request Nov 14, 2017

Auto merge of #45981 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #45815, #45941, #45950, #45951, #45961, #45967, #45970
- Failed merges:
@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Nov 14, 2017

@bors r-

This PR failed in the rollup #45981 at incremental/hashes/if_expressions.rs when testing in x86_64-gnu-nopt. I think this has something to do with the += operator which uses checked arithmetic in debug build.

[01:03:13] ---- [incremental] incremental/hashes/if_expressions.rs stdout ----
[01:03:13] 	
[01:03:13] error in revision `cfail2`: test compilation failed although it shouldn't!
[01:03:13] status: exit code: 101
[01:03:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/incremental/hashes/if_expressions.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental" "--target=x86_64-unknown-linux-gnu" "--cfg" "cfail2" "-Z" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions.inc" "-Z" "incremental-verify-ich" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "query-dep-graph" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:13] stdout:
[01:03:13] ------------------------------------------
[01:03:13] 
[01:03:13] ------------------------------------------
[01:03:13] stderr:
[01:03:13] ------------------------------------------
[01:03:13] {"message":"`MirOptimized(add_else_branch)` should be clean but is not","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/incremental/hashes/if_expressions.rs","byte_start":2817,"byte_end":2938,"line_start":118,"line_end":127,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"pub fn add_else_branch(x: bool) -> u32 {","highlight_start":1,"highlight_end":41},{"text":"    let mut ret = 1;","highlight_start":1,"highlight_end":21},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    if x {","highlight_start":1,"highlight_end":11},{"text":"        ret += 1;","highlight_start":1,"highlight_end":18},{"text":"    } else {","highlight_start":1,"highlight_end":13},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    ret","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
[01:03:13] {"message":"`MirValidated(add_else_branch)` should be clean but is not","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/incremental/hashes/if_expressions.rs","byte_start":2817,"byte_end":2938,"line_start":118,"line_end":127,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"pub fn add_else_branch(x: bool) -> u32 {","highlight_start":1,"highlight_end":41},{"text":"    let mut ret = 1;","highlight_start":1,"highlight_end":21},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    if x {","highlight_start":1,"highlight_end":11},{"text":"        ret += 1;","highlight_start":1,"highlight_end":18},{"text":"    } else {","highlight_start":1,"highlight_end":13},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    ret","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
[01:03:13] {"message":"`MirValidated(add_else_branch_if_let)` should be clean but is not","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/incremental/hashes/if_expressions.rs","byte_start":4990,"byte_end":5139,"line_start":223,"line_end":232,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {","highlight_start":1,"highlight_end":55},{"text":"    let mut ret = 1;","highlight_start":1,"highlight_end":21},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    if let Some(x) = x {","highlight_start":1,"highlight_end":25},{"text":"        ret += x;","highlight_start":1,"highlight_end":18},{"text":"    } else {","highlight_start":1,"highlight_end":13},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    ret","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
[01:03:13] {"message":"`MirOptimized(add_else_branch_if_let)` should be clean but is not","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/incremental/hashes/if_expressions.rs","byte_start":4990,"byte_end":5139,"line_start":223,"line_end":232,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {","highlight_start":1,"highlight_end":55},{"text":"    let mut ret = 1;","highlight_start":1,"highlight_end":21},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    if let Some(x) = x {","highlight_start":1,"highlight_end":25},{"text":"        ret += x;","highlight_start":1,"highlight_end":18},{"text":"    } else {","highlight_start":1,"highlight_end":13},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    ret","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
[01:03:13] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":null}
[01:03:13] 
[01:03:13] ------------------------------------------
[01:03:13] 
[01:03:13] thread '[incremental] incremental/hashes/if_expressions.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2506:8
[01:03:13] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:03:13] 
[01:03:13] 
[01:03:13] failures:
[01:03:13]     [incremental] incremental/hashes/if_expressions.rs
[01:03:13] 
[01:03:13] test result: �[31mFAILED�(B�[m. 81 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
@CrockAgile

This comment has been minimized.

Copy link
Contributor Author

CrockAgile commented Nov 14, 2017

@kennytm as you say, the checked arithmetic is probably the culprit. From what I can tell, these tests were not intended to check this behavior, and other tests in panci_exprs.rs already do. Should these test functions be changed then so they do not include checked arithmetic, and focus on the addition of an else branch? I'll try removing the checked arithmetic, but if that isn't ideal then I am open to other ideas

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Nov 14, 2017

@CrockAgile I prefer to change it to something that doesn't involve checked arithmetic (e.g. ^=), but I'll let @michaelwoerister decide what should be the proper change.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Nov 15, 2017

Thanks, that's the solution I would have proposed too.

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 15, 2017

📌 Commit d1a83c6 has been approved by michaelwoerister

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 16, 2017

Rollup merge of rust-lang#45951 - CrockAgile:master, r=michaelwoerister
incr: Update hash tests to use `except`-style checking

Part of rust-lang#44924

r? @michaelwoerister

bors added a commit that referenced this pull request Nov 16, 2017

Auto merge of #46029 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests

- Successful merges: #45951, #45973, #45984, #45993, #46005, #46010
- Failed merges:

bors added a commit that referenced this pull request Nov 16, 2017

Auto merge of #46029 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests

- Successful merges: #45951, #45973, #45984, #45993, #46005, #46010
- Failed merges:

@bors bors merged commit d1a83c6 into rust-lang:master Nov 16, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.