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
Merged

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

merged 6 commits into from
Nov 16, 2017

Conversation

CrockAgile
Copy link
Contributor

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 2017
@michaelwoerister
Copy link
Member

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

@bors r+

@bors
Copy link
Contributor

bors commented Nov 13, 2017

📌 Commit 6424688 has been approved by michaelwoerister

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2017
@michaelwoerister
Copy link
Member

@bors rollup

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 14, 2017
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
Rollup of 7 pull requests

- Successful merges: #45815, #45941, #45950, #45951, #45961, #45967, #45970
- Failed merges:
@kennytm
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

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 14, 2017
@CrockAgile
Copy link
Contributor Author

@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
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.

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 14, 2017
@michaelwoerister
Copy link
Member

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

@bors r+

@bors
Copy link
Contributor

bors commented Nov 15, 2017

📌 Commit d1a83c6 has been approved by michaelwoerister

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 15, 2017
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 16, 2017
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants