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

[let_chains, 1/6] Remove hir::ExprKind::If #59288

Merged
merged 5 commits into from May 11, 2019

Conversation

Projects
None yet
9 participants
@Centril
Copy link
Member

commented Mar 19, 2019

Per #53667 (comment).

r? @oli-obk

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Mar 19, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0bb31640:start=1552976406927820094,finish=1552976410099399707,duration=3171579613
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:19:03] 
[01:19:03] running 39 tests
[01:19:05] ERROR 2019-03-19T07:39:26Z: compiletest::runtest: None
[01:19:08] ERROR 2019-03-19T07:39:28Z: compiletest::runtest: Some("    bb3: {")
[01:19:09] ERROR 2019-03-19T07:39:30Z: compiletest::runtest: None
[01:19:15] ERROR 2019-03-19T07:39:36Z: compiletest::runtest: Some("    bb1: {")
[01:19:16] ERROR 2019-03-19T07:39:36Z: compiletest::runtest: None
[01:19:22] ......F.......F.....F.....F..F.F.......
[01:19:22] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:19:22] 
[01:19:22] ---- [mir-opt] mir-opt/deaggregator_test_enum_2.rs stdout ----
[01:19:22] ---- [mir-opt] mir-opt/deaggregator_test_enum_2.rs stdout ----
[01:19:22] thread '[mir-opt] mir-opt/deaggregator_test_enum_2.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:19:22] Current block: None
[01:19:22] Actual Line: "        StorageLive(_5);"
[01:19:22] Expected Line: "     StorageLive(_4);"
[01:19:22] Test Name: rustc.test1.Deaggregator.before.mir
[01:19:22] ... (elided)
[01:19:22]  bb1: {
[01:19:22]  bb1: {
[01:19:22]      StorageLive(_4);
[01:19:22]      _4 = _2;
[01:19:22]      _0 = Foo::A(move _4,);
[01:19:22]      StorageDead(_4);
[01:19:22]      goto -> bb3;
[01:19:22]  bb2: {
[01:19:22]  bb2: {
[01:19:22]      StorageLive(_5);
[01:19:22]      _5 = _2;
[01:19:22]      _0 = Foo::B(move _5,);
[01:19:22]      StorageDead(_5);
[01:19:22]      goto -> bb3;
[01:19:22] Actual:
[01:19:22] | User Type Annotations
[01:19:22] | User Type Annotations
[01:19:22] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/deaggregator_test_enum_2.rs:9:5: 13:6
[01:19:22] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/deaggregator_test_enum_2.rs:9:5: 13:6
[01:19:22] |
[01:19:22] fn  test1(_1: bool, _2: i32) -> Foo {
[01:19:22]     let mut _0: Foo;
[01:19:22]     scope 1 {
[01:19:22]     scope 2 {
[01:19:22]     scope 2 {
[01:19:22]         let _4: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:19:22]     let mut _3: bool;
[01:19:22]     let mut _5: i32;
[01:19:22]     let mut _6: i32;
[01:19:22]     let mut _6: i32;
[01:19:22]     bb0: {                              
[01:19:22]         StorageLive(_3);
[01:19:22]         StorageLive(_4);
[01:19:22]         _4 = _1;
[01:19:22]         _3 = _4;
[01:19:22]         StorageDead(_4);
[01:19:22]         switchInt(_3) -> [false: bb2, otherwise: bb1];
[01:19:22]     }
[01:19:22]     bb1: {                              
[01:19:22]         StorageLive(_5);
[01:19:22]         _5 = _2;
[01:19:22]         _0 = Foo::A(move _5,);
[01:19:22]         StorageDead(_5);
[01:19:22]         goto -> bb3;
[01:19:22]     }
[01:19:22]     bb2: {                              
[01:19:22]         StorageLive(_6);
[01:19:22]         _6 = _2;
[01:19:22]         _0 = Foo::B(move _6,);
[01:19:22]         StorageDead(_6);
[01:19:22]         goto -> bb3;
[01:19:22]     }
[01:19:22]     bb3: {                              
[01:19:22]         StorageDead(_3);
[01:19:22]         return;
[01:19:22]     bb4: {
[01:19:22]         resume;
[01:19:22]     }
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:19:22] 
[01:19:22] ---- [mir-opt] mir-opt/issue-38669.rs stdout ----
[01:19:22] thread '[mir-opt] mir-opt/issue-38669.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:19:22] Current block:     bb3: {
[01:19:22] Actual Line: "        StorageLive(_5);"
[01:19:22] Expected Line: "        _4 = _1;"
[01:19:22] Test Name: rustc.main.SimplifyCfg-initial.after.mir
[01:19:22] ... (elided)
[01:19:22]     bb0: {
[01:19:22]     bb0: {
[01:19:22]         StorageLive(_1);
[01:19:22]         _1 = const false;
[01:19:22]         FakeRead(ForLet, _1);
[01:19:22]         goto -> bb2;
[01:19:22]     bb1: {
[01:19:22]         resume;
[01:19:22]     }
[01:19:22]     bb2: {
[01:19:22]     bb2: {
[01:19:22]         falseUnwind -> [real: bb3, cleanup: bb1];
[01:19:22]     bb3: {
[01:19:22]     bb3: {
[01:19:22]         StorageLive(_4);
[01:19:22]         _4 = _1;
[01:19:22]         switchInt(move _4) -> [false: bb5, otherwise: bb4];
[01:19:22]     bb4: {
[01:19:22]         _0 = ();
[01:19:22]         _0 = ();
[01:19:22]         StorageDead(_4);
[01:19:22]         StorageDead(_1);
[01:19:22]         return;
[01:19:22]     bb5: {
[01:19:22]         _3 = ();
[01:19:22]         _3 = ();
[01:19:22]         StorageDead(_4);
[01:19:22]         _2 = ();
[01:19:22]         goto -> bb2;
[01:19:22]     }
[01:19:22] Actual:
[01:19:22] Actual:
[01:19:22] | User Type Annotations
[01:19:22] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/issue-38669.rs:6:9: 8:10
[01:19:22] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/issue-38669.rs:6:9: 8:10
[01:19:22] |
[01:19:22] fn  main() -> () {
[01:19:22]     let mut _0: ();
[01:19:22]     scope 1 {
[01:19:22]         scope 3 {
[01:19:22]         scope 4 {
[01:19:22]         scope 4 {
[01:19:22]             let _5: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:19:22]     }
[01:19:22]     scope 2 {
[01:19:22]         let mut _1: bool;
[01:19:22]     }
[01:19:22]     }
[01:19:22]     let mut _2: ();
[01:19:22]     let mut _3: ();
[01:19:22]     let mut _4: bool;
[01:19:22]     let mut _6: !;
[01:19:22]     bb0: {                              
[01:19:22]         StorageLive(_1);
[01:19:22]         _1 = const false;
[01:19:22]         FakeRead(ForLet, _1);
[01:19:22]         goto -> bb2;
[01:19:22]     bb1: {
[01:19:22]         resume;
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb2: {                              
[01:19:22]         falseUnwind -> [real: bb3, cleanup: bb1];
[01:19:22]     }
[01:19:22]     bb3: {                              
[01:19:22]         StorageLive(_4);
[01:19:22]         StorageLive(_5);
[01:19:22]         _5 = _1;
[01:19:22]         FakeRead(ForLet, _5);
[01:19:22]         AscribeUserType(_5, o, UserTypeProjection { base: UserType(1), projs: [] });
[01:19:22]         _4 = _5;
[01:19:22]         StorageDead(_5);
[01:19:22]         FakeRead(ForMatchedPlace, _4);
[01:19:22]         switchInt(_4) -> [false: bb5, otherwise: bb4];
[01:19:22]     }
[01:19:22]     bb4: {                              
[01:19:22]         falseEdges -> [real: bb7, imaginary: bb5];
[01:19:22]     }
[01:19:22]     bb5: {                              
[01:19:22]         falseEdges -> [real: bb8, imaginary: bb6];
[01:19:22]     }
[01:19:22]     bb6: {                              
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb7: {                              
[01:19:22]         _0 = ();
[01:19:22]         StorageDead(_4);
[01:19:22]         StorageDead(_1);
[01:19:22]         return;
[01:19:22]     }
[01:19:22]     bb8: {                              
[01:19:22]         _3 = ();
[01:19:22]         StorageDead(_4);
[01:19:22]         _2 = ();
[01:19:22]         goto -> bb2;
[01:19:22]     }
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] 
[01:19:22] ---- [mir-opt] mir-opt/loop_test.rs stdout ----
[01:19:22] thread '[mir-opt] mir-opt/loop_test.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:19:22] Current block: None
[01:19:22] Actual Line: "        falseEdges -> [real: bb6, imaginary: bb4];"
[01:19:22] Expected Line: "       _1 = ();"
[01:19:22] Test Name: rustc.main.SimplifyCfg-qualify-consts.after.mir
[01:19:22] ... (elided)
[01:19:22] ... (elided)
[01:19:22] ... (elided)
[01:19:22]    bb1: { // The cleanup block
[01:19:22]        resume;
[01:19:22] ... (elided)
[01:19:22] ... (elided)
[01:19:22]    bb3: { // Entry into the loop
[01:19:22]        _1 = ();
[01:19:22]        goto -> bb4;
[01:19:22]    }
[01:19:22]    bb4: { // The loop_block
[01:19:22]        falseUnwind -> [real: bb5, cleanup: bb1];
[01:19:22]    }
[01:19:22]    bb5: { // The loop body (body_block)
[01:19:22]        StorageLive(_5);
[01:19:22]        _5 = const 1i32;
[01:19:22]        FakeRead(ForLet, _5);
[01:19:22]        StorageDead(_5);
[01:19:22]        goto -> bb4;
[01:19:22] ... (elided)
[01:19:22] Actual:
[01:19:22] | User Type Annotations
[01:19:22] | User Type Annotations
[01:19:22] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/loop_test.rs:9:5: 11:6
[01:19:22] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/loop_test.rs:9:5: 11:6
[01:19:22] |
[01:19:22] fn  main() -> () {
[01:19:22]     let mut _0: ();
[01:19:22]     scope 1 {
[01:19:22]     scope 2 {
[01:19:22]     scope 2 {
[01:19:22]         let _3: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:19:22]     scope 3 {
[01:19:22]     }
[01:19:22]     scope 4 {
[01:19:22]         let _7: i32;
[01:19:22]         let _7: i32;
[01:19:22]     }
[01:19:22]     let mut _1: ();
[01:19:22]     let mut _2: bool;
[01:19:22]     let mut _4: !;
[01:19:22]     let mut _5: !;
[01:19:22]     let mut _6: ();
[01:19:22]     bb0: {                              
[01:19:22]         StorageLive(_2);
[01:19:22]         StorageLive(_3);
[01:19:22]         _3 = const true;
[01:19:22]         FakeRead(ForLet, _3);
[01:19:22]         AscribeUserType(_3, o, UserTypeProjection { base: UserType(1), projs: [] });
[01:19:22]         _2 = _3;
[01:19:22]         StorageDead(_3);
[01:19:22]         FakeRead(ForMatchedPlace, _2);
[01:19:22]         switchInt(_2) -> [false: bb3, otherwise: bb2];
[01:19:22]     bb1: {
[01:19:22]         resume;
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb2: {                              
[01:19:22]         falseEdges -> [real: bb5, imaginary: bb3];
[01:19:22]     }
[01:19:22]     bb3: {                              
[01:19:22]         falseEdges -> [real: bb6, imaginary: bb4];
[01:19:22]     }
[01:19:22]     bb4: {                              
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb5: {                              
[01:19:22]         _0 = ();
[01:19:22]         StorageDead(_2);
[01:19:22]         return;
[01:19:22]     }
[01:19:22]     bb6: {                              
[01:19:22]         _1 = ();
[01:19:22]         StorageDead(_2);
[01:19:22]         goto -> bb7;
[01:19:22]     }
[01:19:22]     bb7: {                              
[01:19:22]         falseUnwind -> [real: bb8, cleanup: bb1];
[01:19:22]     }
[01:19:22]     bb8: {                              
[01:19:22]         StorageLive(_7);
[01:19:22]         _7 = const 1i32;
[01:19:22]         FakeRead(ForLet, _7);
[01:19:22]         StorageDead(_7);
[01:19:22]         goto -> bb7;
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] 
[01:19:22] ---- [mir-opt] mir-opt/nll/region-subtyping-basic.rs stdout ----
[01:19:22] ---- [mir-opt] mir-opt/nll/region-subtyping-basic.rs stdout ----
[01:19:22] thread '[mir-opt] mir-opt/nll/region-subtyping-basic.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
[01:19:22] Expected Line: "| \'_#2r    | U0 | {bb2[0..=5], bb3[0..=1]}"
[01:19:22] Test Name: rustc.main.nll.0.mir
[01:19:22] ... (elided)
[01:19:22] ... (elided)
[01:19:22] | '_#2r    | U0 | {bb2[0..=5], bb3[0..=1]}
[01:19:22] | '_#3r    | U0 | {bb2[1..=5], bb3[0..=1]}
[01:19:22] | '_#4r    | U0 | {bb2[4..=5], bb3[0..=1]}
[01:19:22] Actual:
[01:19:22] | Free Region Mapping
[01:19:22] | '_#0r | Global | ['_#0r, '_#1r]
[01:19:22] | '_#1r | Local | ['_#1r]
[01:19:22] | Inferred Region Values
[01:19:22] | Inferred Region Values
[01:19:22] | '_#0r | U0 | {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4], '_#0r, '_#1r}
[01:19:22] | '_#1r | U0 | {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4], '_#1r}
[01:19:22] | '_#2r | U0 | {bb2[0..=13], bb3[0], bb6[0..=1]}
[01:19:22] | '_#3r | U0 | {bb2[1..=13], bb3[0], bb6[0..=1]}
[01:19:22] | '_#4r | U0 | {bb2[4..=13], bb3[0], bb6[0..=1]}
[01:19:22] | Inference Constraints
[01:19:22] | Inference Constraints
[01:19:22] | '_#0r live at {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4]}
[01:19:22] | '_#1r live at {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4]}
[01:19:22] | '_#2r live at {bb2[0]}
[01:19:22] | '_#3r live at {bb2[1..=3]}
[01:19:22] | '_#4r live at {bb2[4..=13], bb3[0], bb6[0..=1]}
[01:19:22] | '_#2r: '_#3r due to Assignment at Single(bb2[0])
[01:19:22] | '_#3r: '_#4r due to Assignment at Single(bb2[3])
[01:19:22] | User Type Annotations
[01:19:22] | User Type Annotations
[01:19:22] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/nll/region-subtyping-basic.rs:16:5: 20:6
[01:19:22] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/nll/region-subtyping-basic.rs:16:5: 20:6
[01:19:22] |
[01:19:22] fn  main() -> () {
[01:19:22]     let mut _0: ();
[01:19:22]     scope 1 {
[01:19:22]         scope 3 {
[01:19:22]             scope 5 {
[01:19:22]                 scope 7 {
[01:19:22]                 scope 8 {
[01:19:22]                 scope 8 {
[01:19:22]                     let _8: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:19:22]             }
[01:19:22]             scope 6 {
[01:19:22]             scope 6 {
[01:19:22]                 let _6: &'_#4r usize;
[01:19:22]         }
[01:19:22]         scope 4 {
[01:19:22]         scope 4 {
[01:19:22]             let _2: &'_#3r usize;
[01:19:22]     }
[01:19:22]     scope 2 {
[01:19:22]     scope 2 {
[01:19:22]         let mut _1: [usize; 3];
[01:19:22]     let mut _3: usize;
[01:19:22]     let mut _4: usize;
[01:19:22]     let mut _5: bool;
[01:19:22]     let mut _7: bool;
[01:19:22]     let mut _7: bool;
[01:19:22]     let mut _9: bool;
[01:19:22]     let mut _10: usize;
[01:19:22]     let mut _11: bool;
[01:19:22]     bb0: {                              
[01:19:22]         StorageLive(_1);
[01:19:22]         _1 = [const 1usize, const 2usize, const 3usize];
[01:19:22]         FakeRead(ForLet, _1);
[01:19:22]         StorageLive(_2);
[01:19:22]         StorageLive(_3);
[01:19:22]         _4 = Len(_1);
[01:19:22]         _4 = Len(_1);
[01:19:22]         _5 = Lt(_3, _4);
[01:19:22]         assert(move _5, "index out of bounds: the len is move _4 but the index is _3") -> [success: bb2, unwind: bb1];
[01:19:22]     bb1: {
[01:19:22]         resume;
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb2: {                              
[01:19:22]         _2 = &'_#2r _1[_3];
[01:19:22]         FakeRead(ForLet, _2);
[01:19:22]         StorageLive(_6);
[01:19:22]         _6 = _2;
[01:19:22]         FakeRead(ForLet, _6);
[01:19:22]         StorageLive(_7);
[01:19:22]         StorageLive(_8);
[01:19:22]         _8 = const true;
[01:19:22]         FakeRead(ForLet, _8);
[01:19:22]         AscribeUserType(_8, o, UserTypeProjection { base: UserType(1), projs: [] });
[01:19:22]         _7 = _8;
[01:19:22]         StorageDead(_8);
[01:19:22]         FakeRead(ForMatchedPlace, _7);
[01:19:22]         switchInt(_7) -> [false: bb4, otherwise: bb3];
[01:19:22]     }
[01:19:22]     bb3: {                              
[01:19:22]         falseEdges -> [real: bb6, imaginary: bb4];
[01:19:22]     }
[01:19:22]     bb4: {                              
[01:19:22]         falseEdges -> [real: bb8, imaginary: bb5];
[01:19:22]     }
[01:19:22]     bb5: {                              
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb6: {                              
[01:19:22]         StorageLive(_10);
[01:19:22]         _10 = (*_6);
[01:19:22]         _9 = const use_x(move _10) -> [return: bb7, unwind: bb1];
[01:19:22]     }
[01:19:22]     bb7: {                              
[01:19:22]         StorageDead(_10);
[01:19:22]         _0 = ();
[01:19:22]         goto -> bb10;
[01:19:22]     }
[01:19:22]     bb8: {                              
[01:19:22]         _11 = const use_x(const 22usize) -> [return: bb9, unwind: bb1];
[01:19:22]     }
[01:19:22]     bb9: {                              
[01:19:22]         _0 = ();
[01:19:22]         goto -> bb10;
[01:19:22]     }
[01:19:22]     bb10: {                             
[01:19:22]         StorageDead(_6);
[01:19:22]         StorageDead(_2);
[01:19:22]         StorageDead(_1);
[01:19:22]         StorageDead(_7);
[01:19:22]         return;
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] 
[01:19:22] ---- [mir-opt] mir-opt/simplify_cfg.rs stdout ----
[01:19:22] ---- [mir-opt] mir-opt/simplify_cfg.rs stdout ----
[01:19:22] thread '[mir-opt] mir-opt/simplify_cfg.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:19:22] Current block:     bb1: {
[01:19:22] Actual Line: "        StorageLive(_3);"
[01:19:22] Expected Line: "        _2 = const bar() -> bb3;"
[01:19:22] Test Name: rustc.main.SimplifyCfg-early-opt.before.mir
[01:19:22] ... (elided)
[01:19:22]     bb0: {
[01:19:22]         goto -> bb1;
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb1: {
[01:19:22]         StorageLive(_2);
[01:19:22]         _2 = const bar() -> bb3;
[01:19:22] Actual:
[01:19:22] | User Type Annotations
[01:19:22] | User Type Annotations
[01:19:22] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_cfg.rs:5:9: 7:10
[01:19:22] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_cfg.rs:5:9: 7:10
[01:19:22] |
[01:19:22] fn  main() -> () {
[01:19:22]     let mut _0: ();
[01:19:22]     scope 1 {
[01:19:22]     scope 2 {
[01:19:22]     scope 2 {
[01:19:22]         let _3: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:19:22]     let mut _1: ();
[01:19:22]     let mut _2: bool;
[01:19:22]     let mut _4: !;
[01:19:22]     let mut _4: !;
[01:19:22]     bb0: {                              
[01:19:22]         goto -> bb1;
[01:19:22]     }
[01:19:22]     bb1: {                              
[01:19:22]         StorageLive(_2);
[01:19:22]         StorageLive(_3);
[01:19:22]         _3 = const bar() -> bb3;
[01:19:22]     bb2: {
[01:19:22]         resume;
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb3: {                              
[01:19:22]         nop;
[01:19:22]         _2 = _3;
[01:19:22]         _2 = _3;
[01:19:22]         StorageDead(_3);
[01:19:22]         nop;
[01:19:22]         switchInt(_2) -> [false: bb5, otherwise: bb4];
[01:19:22]     }
[01:19:22]     bb4: {                              
[01:19:22]         goto -> bb7;
[01:19:22]     }
[01:19:22]     bb5: {                              
[01:19:22]         goto -> bb8;
[01:19:22]     }
[01:19:22]     bb6: {                              
[01:19:22]     }
[01:19:22]     }
[01:19:22]     bb7: {                              
[01:19:22]         _0 = ();
[01:19:22]         StorageDead(_2);
[01:19:22]         return;
[01:19:22]     }
[01:19:22]     bb8: {                              
[01:19:22]         _1 = ();
[01:19:22]         StorageDead(_2);
[01:19:22]         goto -> bb0;
[01:19:22] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:19:22] 
[01:19:22] ---- [mir-opt] mir-opt/simplify_if.rs stdout ----
[01:19:22] ---- [mir-opt] mir-opt/simplify_if.rs stdout ----
[01:19:22] thread '[mir-opt] mir-opt/simplify_if.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:19:22] Current block: None
[01:19:22] Actual Line: "        StorageLive(_1);"
[01:19:22] Expected Line: "    switchInt(const false) -> [false: bb3, otherwise: bb2];"
[01:19:22] Test Name: rustc.main.SimplifyBranches-initial.before.mir
[01:19:22] ... (elided)
[01:19:22] bb0: {
[01:19:22] bb0: {
[01:19:22]     switchInt(const false) -> [false: bb3, otherwise: bb2];
[01:19:22] }
[01:19:22] Actual:
[01:19:22] | User Type Annotations
[01:19:22] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_if.rs:2:5: 4:6
[01:19:22] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_if.rs:2:5: 4:6
[01:19:22] | 2: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: TypeOf(DefId(2/0:4210 ~ core[1e18]::fmt[0]::{{impl}}[2]::new_v1[0]), UserSubsts { substs: [ReLateBound(DebruijnIndex(0), BrAnon(0))], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:4209 ~ core[1e18]::fmt[0]::{{impl}}[2]), self_ty: std::fmt::Arguments<'_> }) }) } at <::std::macros::println macros>:2:29: 2:63
[01:19:22] |
[01:19:22] fn  main() -> () {
[01:19:22]     let mut _0: ();
[01:19:22]     scope 1 {
---
[01:19:22] test result: FAILED. 33 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out
[01:19:22] 
[01:19:22] 
[01:19:22] 
[01:19:22] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:19:22] 
[01:19:22] 
[01:19:22] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:19:22] Build completed unsuccessfully in 0:11:26
[01:19:22] Build completed unsuccessfully in 0:11:26
[01:19:22] Makefile:48: recipe for target 'check' failed
[01:19:22] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1383b79a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Mar 19 07:39:44 UTC 2019

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

IIRC, I got some lifetime issues after trying to desugar all ifs into matches (rather than those containing is), with RefCells being held for too long (or too little?) and panicking etc.
Don't remember the details right now, perhaps it's fixable.

@petrochenkov

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

This seems like a nice simplification even regardless of if-let chains, we only need to make sure that it doesn't regress 1) codegen 2) compile times, and 3) diagnostics.

Similarly, desugaring while into loop is also required for implementing pattern matching expressions, but is also a nice simplification otherwise.

(I'll try to review the code later today.)

@petrochenkov

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

On the other hand, the desugaring for pattern matching expressions at the AST/HIR border turned out incredibly hacky, when I tried it.
It also made impossible to support those expressions in pattern guards.

match thing {
    PAT(y) if let Some(x) = y {
        print(x); // Nope
    }
}

So it's a pretty real possibility that it's better done somewhere at HIR->MIR time.

@Centril

This comment has been minimized.

Copy link
Member Author

commented Mar 19, 2019

This seems like a nice simplification even regardless of if-let chains, we only need to make sure that it doesn't regress 1) codegen 2) compile times, and 3) diagnostics.

I think I fixed all diagnostics issues that I had... some even got improved. :) As for codegen there are issues in #59288 (comment) wrt. mir-opt tests (thus the WIP) that I don't really understand yet.

Similarly, desugaring while into loop is also required for implementing pattern matching expressions, but is also a nice simplification otherwise.

Yup, I'd like to do that as step 4 in the process after having done the if part of the RFC fully. Maybe even remove continue from HIR after step 6...

(I'll try to review the code later today.)

:)

On the other hand, the desugaring for pattern matching expressions at the AST/HIR border turned out incredibly hacky, when I tried it.

When I tried it out with LBV + a fold in lowering it didn't feel so bad. Haven't thought about the implications of if-let-guards + if-let-chains tho wrt. lowering. :)

@Centril Centril force-pushed the Centril:hir-if-to-match branch from 35ac9ca to b5613e3 Mar 19, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Mar 19, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:00663fd6:start=1552984743330392096,finish=1552984746808837528,duration=3478445432
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:19:57] 
[01:19:57] running 39 tests
[01:20:00] ERROR 2019-03-19T09:59:16Z: compiletest::runtest: None
[01:20:02] ERROR 2019-03-19T09:59:18Z: compiletest::runtest: Some("    bb3: {")
[01:20:03] ERROR 2019-03-19T09:59:20Z: compiletest::runtest: None
[01:20:10] ERROR 2019-03-19T09:59:26Z: compiletest::runtest: Some("    bb1: {")
[01:20:11] ERROR 2019-03-19T09:59:27Z: compiletest::runtest: None
[01:20:18] ......F.......F....F......F..F.F.......
[01:20:18] failures:
[01:20:18] 
[01:20:18] ---- [mir-opt] mir-opt/deaggregator_test_enum_2.rs stdout ----
[01:20:18] ---- [mir-opt] mir-opt/deaggregator_test_enum_2.rs stdout ----
[01:20:18] thread '[mir-opt] mir-opt/deaggregator_test_enum_2.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:20:18] Current block: None
[01:20:18] Actual Line: "        StorageLive(_5);"
[01:20:18] Expected Line: "     StorageLive(_4);"
[01:20:18] Test Name: rustc.test1.Deaggregator.before.mir
[01:20:18] ... (elided)
[01:20:18]  bb1: {
[01:20:18]  bb1: {
[01:20:18]      StorageLive(_4);
[01:20:18]      _4 = _2;
[01:20:18]      _0 = Foo::A(move _4,);
[01:20:18]      StorageDead(_4);
[01:20:18]      goto -> bb3;
[01:20:18]  bb2: {
[01:20:18]  bb2: {
[01:20:18]      StorageLive(_5);
[01:20:18]      _5 = _2;
[01:20:18]      _0 = Foo::B(move _5,);
[01:20:18]      StorageDead(_5);
[01:20:18]      goto -> bb3;
[01:20:18] Actual:
[01:20:18] | User Type Annotations
[01:20:18] | User Type Annotations
[01:20:18] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/deaggregator_test_enum_2.rs:9:5: 13:6
[01:20:18] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/deaggregator_test_enum_2.rs:9:5: 13:6
[01:20:18] |
[01:20:18] fn  test1(_1: bool, _2: i32) -> Foo {
[01:20:18]     let mut _0: Foo;
[01:20:18]     scope 1 {
[01:20:18]     scope 2 {
[01:20:18]     scope 2 {
[01:20:18]         let _4: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:20:18]     let mut _3: bool;
[01:20:18]     let mut _5: i32;
[01:20:18]     let mut _6: i32;
[01:20:18]     let mut _6: i32;
[01:20:18]     bb0: {                              
[01:20:18]         StorageLive(_3);
[01:20:18]         StorageLive(_4);
[01:20:18]         _4 = _1;
[01:20:18]         _3 = _4;
[01:20:18]         StorageDead(_4);
[01:20:18]         switchInt(_3) -> [false: bb2, otherwise: bb1];
[01:20:18]     }
[01:20:18]     bb1: {                              
[01:20:18]         StorageLive(_5);
[01:20:18]         _5 = _2;
[01:20:18]         _0 = Foo::A(move _5,);
[01:20:18]         StorageDead(_5);
[01:20:18]         goto -> bb3;
[01:20:18]     }
[01:20:18]     bb2: {                              
[01:20:18]         StorageLive(_6);
[01:20:18]         _6 = _2;
[01:20:18]         _0 = Foo::B(move _6,);
[01:20:18]         StorageDead(_6);
[01:20:18]         goto -> bb3;
[01:20:18]     }
[01:20:18]     bb3: {                              
[01:20:18]         StorageDead(_3);
[01:20:18]         return;
[01:20:18]     bb4: {
[01:20:18]         resume;
[01:20:18]     }
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:20:18] 
[01:20:18] ---- [mir-opt] mir-opt/issue-38669.rs stdout ----
[01:20:18] thread '[mir-opt] mir-opt/issue-38669.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:20:18] Current block:     bb3: {
[01:20:18] Actual Line: "        StorageLive(_5);"
[01:20:18] Expected Line: "        _4 = _1;"
[01:20:18] Test Name: rustc.main.SimplifyCfg-initial.after.mir
[01:20:18] ... (elided)
[01:20:18]     bb0: {
[01:20:18]     bb0: {
[01:20:18]         StorageLive(_1);
[01:20:18]         _1 = const false;
[01:20:18]         FakeRead(ForLet, _1);
[01:20:18]         goto -> bb2;
[01:20:18]     bb1: {
[01:20:18]         resume;
[01:20:18]     }
[01:20:18]     bb2: {
[01:20:18]     bb2: {
[01:20:18]         falseUnwind -> [real: bb3, cleanup: bb1];
[01:20:18]     bb3: {
[01:20:18]     bb3: {
[01:20:18]         StorageLive(_4);
[01:20:18]         _4 = _1;
[01:20:18]         switchInt(move _4) -> [false: bb5, otherwise: bb4];
[01:20:18]     bb4: {
[01:20:18]         _0 = ();
[01:20:18]         _0 = ();
[01:20:18]         StorageDead(_4);
[01:20:18]         StorageDead(_1);
[01:20:18]         return;
[01:20:18]     bb5: {
[01:20:18]         _3 = ();
[01:20:18]         _3 = ();
[01:20:18]         StorageDead(_4);
[01:20:18]         _2 = ();
[01:20:18]         goto -> bb2;
[01:20:18]     }
[01:20:18] Actual:
[01:20:18] Actual:
[01:20:18] | User Type Annotations
[01:20:18] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/issue-38669.rs:6:9: 8:10
[01:20:18] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/issue-38669.rs:6:9: 8:10
[01:20:18] |
[01:20:18] fn  main() -> () {
[01:20:18]     let mut _0: ();
[01:20:18]     scope 1 {
[01:20:18]         scope 3 {
[01:20:18]         scope 4 {
[01:20:18]         scope 4 {
[01:20:18]             let _5: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:20:18]     }
[01:20:18]     scope 2 {
[01:20:18]         let mut _1: bool;
[01:20:18]     }
[01:20:18]     }
[01:20:18]     let mut _2: ();
[01:20:18]     let mut _3: ();
[01:20:18]     let mut _4: bool;
[01:20:18]     let mut _6: !;
[01:20:18]     bb0: {                              
[01:20:18]         StorageLive(_1);
[01:20:18]         _1 = const false;
[01:20:18]         FakeRead(ForLet, _1);
[01:20:18]         goto -> bb2;
[01:20:18]     bb1: {
[01:20:18]         resume;
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb2: {                              
[01:20:18]         falseUnwind -> [real: bb3, cleanup: bb1];
[01:20:18]     }
[01:20:18]     bb3: {                              
[01:20:18]         StorageLive(_4);
[01:20:18]         StorageLive(_5);
[01:20:18]         _5 = _1;
[01:20:18]         FakeRead(ForLet, _5);
[01:20:18]         AscribeUserType(_5, o, UserTypeProjection { base: UserType(1), projs: [] });
[01:20:18]         _4 = _5;
[01:20:18]         StorageDead(_5);
[01:20:18]         FakeRead(ForMatchedPlace, _4);
[01:20:18]         switchInt(_4) -> [false: bb5, otherwise: bb4];
[01:20:18]     }
[01:20:18]     bb4: {                              
[01:20:18]         falseEdges -> [real: bb7, imaginary: bb5];
[01:20:18]     }
[01:20:18]     bb5: {                              
[01:20:18]         falseEdges -> [real: bb8, imaginary: bb6];
[01:20:18]     }
[01:20:18]     bb6: {                              
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb7: {                              
[01:20:18]         _0 = ();
[01:20:18]         StorageDead(_4);
[01:20:18]         StorageDead(_1);
[01:20:18]         return;
[01:20:18]     }
[01:20:18]     bb8: {                              
[01:20:18]         _3 = ();
[01:20:18]         StorageDead(_4);
[01:20:18]         _2 = ();
[01:20:18]         goto -> bb2;
[01:20:18]     }
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] 
[01:20:18] ---- [mir-opt] mir-opt/loop_test.rs stdout ----
[01:20:18] thread '[mir-opt] mir-opt/loop_test.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:20:18] Current block: None
[01:20:18] Actual Line: "        falseEdges -> [real: bb6, imaginary: bb4];"
[01:20:18] Expected Line: "       _1 = ();"
[01:20:18] Test Name: rustc.main.SimplifyCfg-qualify-consts.after.mir
[01:20:18] ... (elided)
[01:20:18] ... (elided)
[01:20:18] ... (elided)
[01:20:18]    bb1: { // The cleanup block
[01:20:18]        resume;
[01:20:18] ... (elided)
[01:20:18] ... (elided)
[01:20:18]    bb3: { // Entry into the loop
[01:20:18]        _1 = ();
[01:20:18]        goto -> bb4;
[01:20:18]    }
[01:20:18]    bb4: { // The loop_block
[01:20:18]        falseUnwind -> [real: bb5, cleanup: bb1];
[01:20:18]    }
[01:20:18]    bb5: { // The loop body (body_block)
[01:20:18]        StorageLive(_5);
[01:20:18]        _5 = const 1i32;
[01:20:18]        FakeRead(ForLet, _5);
[01:20:18]        StorageDead(_5);
[01:20:18]        goto -> bb4;
[01:20:18] ... (elided)
[01:20:18] Actual:
[01:20:18] | User Type Annotations
[01:20:18] | User Type Annotations
[01:20:18] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/loop_test.rs:9:5: 11:6
[01:20:18] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/loop_test.rs:9:5: 11:6
[01:20:18] |
[01:20:18] fn  main() -> () {
[01:20:18]     let mut _0: ();
[01:20:18]     scope 1 {
[01:20:18]     scope 2 {
[01:20:18]     scope 2 {
[01:20:18]         let _3: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:20:18]     scope 3 {
[01:20:18]     }
[01:20:18]     scope 4 {
[01:20:18]         let _7: i32;
[01:20:18]         let _7: i32;
[01:20:18]     }
[01:20:18]     let mut _1: ();
[01:20:18]     let mut _2: bool;
[01:20:18]     let mut _4: !;
[01:20:18]     let mut _5: !;
[01:20:18]     let mut _6: ();
[01:20:18]     bb0: {                              
[01:20:18]         StorageLive(_2);
[01:20:18]         StorageLive(_3);
[01:20:18]         _3 = const true;
[01:20:18]         FakeRead(ForLet, _3);
[01:20:18]         AscribeUserType(_3, o, UserTypeProjection { base: UserType(1), projs: [] });
[01:20:18]         _2 = _3;
[01:20:18]         StorageDead(_3);
[01:20:18]         FakeRead(ForMatchedPlace, _2);
[01:20:18]         switchInt(_2) -> [false: bb3, otherwise: bb2];
[01:20:18]     bb1: {
[01:20:18]         resume;
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb2: {                              
[01:20:18]         falseEdges -> [real: bb5, imaginary: bb3];
[01:20:18]     }
[01:20:18]     bb3: {                              
[01:20:18]         falseEdges -> [real: bb6, imaginary: bb4];
[01:20:18]     }
[01:20:18]     bb4: {                              
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb5: {                              
[01:20:18]         _0 = ();
[01:20:18]         StorageDead(_2);
[01:20:18]         return;
[01:20:18]     }
[01:20:18]     bb6: {                              
[01:20:18]         _1 = ();
[01:20:18]         StorageDead(_2);
[01:20:18]         goto -> bb7;
[01:20:18]     }
[01:20:18]     bb7: {                              
[01:20:18]         falseUnwind -> [real: bb8, cleanup: bb1];
[01:20:18]     }
[01:20:18]     bb8: {                              
[01:20:18]         StorageLive(_7);
[01:20:18]         _7 = const 1i32;
[01:20:18]         FakeRead(ForLet, _7);
[01:20:18]         StorageDead(_7);
[01:20:18]         goto -> bb7;
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] 
[01:20:18] ---- [mir-opt] mir-opt/nll/region-subtyping-basic.rs stdout ----
[01:20:18] ---- [mir-opt] mir-opt/nll/region-subtyping-basic.rs stdout ----
[01:20:18] thread '[mir-opt] mir-opt/nll/region-subtyping-basic.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
[01:20:18] Expected Line: "| \'_#2r    | U0 | {bb2[0..=5], bb3[0..=1]}"
[01:20:18] Test Name: rustc.main.nll.0.mir
[01:20:18] ... (elided)
[01:20:18] ... (elided)
[01:20:18] | '_#2r    | U0 | {bb2[0..=5], bb3[0..=1]}
[01:20:18] | '_#3r    | U0 | {bb2[1..=5], bb3[0..=1]}
[01:20:18] | '_#4r    | U0 | {bb2[4..=5], bb3[0..=1]}
[01:20:18] Actual:
[01:20:18] | Free Region Mapping
[01:20:18] | '_#0r | Global | ['_#0r, '_#1r]
[01:20:18] | '_#1r | Local | ['_#1r]
[01:20:18] | Inferred Region Values
[01:20:18] | Inferred Region Values
[01:20:18] | '_#0r | U0 | {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4], '_#0r, '_#1r}
[01:20:18] | '_#1r | U0 | {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4], '_#1r}
[01:20:18] | '_#2r | U0 | {bb2[0..=13], bb3[0], bb6[0..=1]}
[01:20:18] | '_#3r | U0 | {bb2[1..=13], bb3[0], bb6[0..=1]}
[01:20:18] | '_#4r | U0 | {bb2[4..=13], bb3[0], bb6[0..=1]}
[01:20:18] | Inference Constraints
[01:20:18] | Inference Constraints
[01:20:18] | '_#0r live at {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4]}
[01:20:18] | '_#1r live at {bb0[0..=8], bb1[0], bb2[0..=13], bb3[0], bb4[0], bb5[0], bb6[0..=2], bb7[0..=2], bb8[0], bb9[0..=1], bb10[0..=4]}
[01:20:18] | '_#2r live at {bb2[0]}
[01:20:18] | '_#3r live at {bb2[1..=3]}
[01:20:18] | '_#4r live at {bb2[4..=13], bb3[0], bb6[0..=1]}
[01:20:18] | '_#2r: '_#3r due to Assignment at Single(bb2[0])
[01:20:18] | '_#3r: '_#4r due to Assignment at Single(bb2[3])
[01:20:18] | User Type Annotations
[01:20:18] | User Type Annotations
[01:20:18] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/nll/region-subtyping-basic.rs:16:5: 20:6
[01:20:18] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/nll/region-subtyping-basic.rs:16:5: 20:6
[01:20:18] |
[01:20:18] fn  main() -> () {
[01:20:18]     let mut _0: ();
[01:20:18]     scope 1 {
[01:20:18]         scope 3 {
[01:20:18]             scope 5 {
[01:20:18]                 scope 7 {
[01:20:18]                 scope 8 {
[01:20:18]                 scope 8 {
[01:20:18]                     let _8: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:20:18]             }
[01:20:18]             scope 6 {
[01:20:18]             scope 6 {
[01:20:18]                 let _6: &'_#4r usize;
[01:20:18]         }
[01:20:18]         scope 4 {
[01:20:18]         scope 4 {
[01:20:18]             let _2: &'_#3r usize;
[01:20:18]     }
[01:20:18]     scope 2 {
[01:20:18]     scope 2 {
[01:20:18]         let mut _1: [usize; 3];
[01:20:18]     let mut _3: usize;
[01:20:18]     let mut _4: usize;
[01:20:18]     let mut _5: bool;
[01:20:18]     let mut _7: bool;
[01:20:18]     let mut _7: bool;
[01:20:18]     let mut _9: bool;
[01:20:18]     let mut _10: usize;
[01:20:18]     let mut _11: bool;
[01:20:18]     bb0: {                              
[01:20:18]         StorageLive(_1);
[01:20:18]         _1 = [const 1usize, const 2usize, const 3usize];
[01:20:18]         FakeRead(ForLet, _1);
[01:20:18]         StorageLive(_2);
[01:20:18]         StorageLive(_3);
[01:20:18]         _4 = Len(_1);
[01:20:18]         _4 = Len(_1);
[01:20:18]         _5 = Lt(_3, _4);
[01:20:18]         assert(move _5, "index out of bounds: the len is move _4 but the index is _3") -> [success: bb2, unwind: bb1];
[01:20:18]     bb1: {
[01:20:18]         resume;
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb2: {                              
[01:20:18]         _2 = &'_#2r _1[_3];
[01:20:18]         FakeRead(ForLet, _2);
[01:20:18]         StorageLive(_6);
[01:20:18]         _6 = _2;
[01:20:18]         FakeRead(ForLet, _6);
[01:20:18]         StorageLive(_7);
[01:20:18]         StorageLive(_8);
[01:20:18]         _8 = const true;
[01:20:18]         FakeRead(ForLet, _8);
[01:20:18]         AscribeUserType(_8, o, UserTypeProjection { base: UserType(1), projs: [] });
[01:20:18]         _7 = _8;
[01:20:18]         StorageDead(_8);
[01:20:18]         FakeRead(ForMatchedPlace, _7);
[01:20:18]         switchInt(_7) -> [false: bb4, otherwise: bb3];
[01:20:18]     }
[01:20:18]     bb3: {                              
[01:20:18]         falseEdges -> [real: bb6, imaginary: bb4];
[01:20:18]     }
[01:20:18]     bb4: {                              
[01:20:18]         falseEdges -> [real: bb8, imaginary: bb5];
[01:20:18]     }
[01:20:18]     bb5: {                              
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb6: {                              
[01:20:18]         StorageLive(_10);
[01:20:18]         _10 = (*_6);
[01:20:18]         _9 = const use_x(move _10) -> [return: bb7, unwind: bb1];
[01:20:18]     }
[01:20:18]     bb7: {                              
[01:20:18]         StorageDead(_10);
[01:20:18]         _0 = ();
[01:20:18]         goto -> bb10;
[01:20:18]     }
[01:20:18]     bb8: {                              
[01:20:18]         _11 = const use_x(const 22usize) -> [return: bb9, unwind: bb1];
[01:20:18]     }
[01:20:18]     bb9: {                              
[01:20:18]         _0 = ();
[01:20:18]         goto -> bb10;
[01:20:18]     }
[01:20:18]     bb10: {                             
[01:20:18]         StorageDead(_6);
[01:20:18]         StorageDead(_2);
[01:20:18]         StorageDead(_1);
[01:20:18]         StorageDead(_7);
[01:20:18]         return;
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] 
[01:20:18] ---- [mir-opt] mir-opt/simplify_cfg.rs stdout ----
[01:20:18] ---- [mir-opt] mir-opt/simplify_cfg.rs stdout ----
[01:20:18] thread '[mir-opt] mir-opt/simplify_cfg.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:20:18] Current block:     bb1: {
[01:20:18] Actual Line: "        StorageLive(_3);"
[01:20:18] Expected Line: "        _2 = const bar() -> bb3;"
[01:20:18] Test Name: rustc.main.SimplifyCfg-early-opt.before.mir
[01:20:18] ... (elided)
[01:20:18]     bb0: {
[01:20:18]         goto -> bb1;
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb1: {
[01:20:18]         StorageLive(_2);
[01:20:18]         _2 = const bar() -> bb3;
[01:20:18] Actual:
[01:20:18] | User Type Annotations
[01:20:18] | User Type Annotations
[01:20:18] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_cfg.rs:5:9: 7:10
[01:20:18] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_cfg.rs:5:9: 7:10
[01:20:18] |
[01:20:18] fn  main() -> () {
[01:20:18]     let mut _0: ();
[01:20:18]     scope 1 {
[01:20:18]     scope 2 {
[01:20:18]     scope 2 {
[01:20:18]         let _3: bool as UserTypeProjection { base: UserType(0), projs: [] };
[01:20:18]     let mut _1: ();
[01:20:18]     let mut _2: bool;
[01:20:18]     let mut _4: !;
[01:20:18]     let mut _4: !;
[01:20:18]     bb0: {                              
[01:20:18]         goto -> bb1;
[01:20:18]     }
[01:20:18]     bb1: {                              
[01:20:18]         StorageLive(_2);
[01:20:18]         StorageLive(_3);
[01:20:18]         _3 = const bar() -> bb3;
[01:20:18]     bb2: {
[01:20:18]         resume;
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb3: {                              
[01:20:18]         nop;
[01:20:18]         _2 = _3;
[01:20:18]         _2 = _3;
[01:20:18]         StorageDead(_3);
[01:20:18]         nop;
[01:20:18]         switchInt(_2) -> [false: bb5, otherwise: bb4];
[01:20:18]     }
[01:20:18]     bb4: {                              
[01:20:18]         goto -> bb7;
[01:20:18]     }
[01:20:18]     bb5: {                              
[01:20:18]         goto -> bb8;
[01:20:18]     }
[01:20:18]     bb6: {                              
[01:20:18]     }
[01:20:18]     }
[01:20:18]     bb7: {                              
[01:20:18]         _0 = ();
[01:20:18]         StorageDead(_2);
[01:20:18]         return;
[01:20:18]     }
[01:20:18]     bb8: {                              
[01:20:18]         _1 = ();
[01:20:18]         StorageDead(_2);
[01:20:18]         goto -> bb0;
[01:20:18] }', src/tools/compiletest/src/runtest.rs:2984:13
[01:20:18] 
[01:20:18] ---- [mir-opt] mir-opt/simplify_if.rs stdout ----
[01:20:18] ---- [mir-opt] mir-opt/simplify_if.rs stdout ----
[01:20:18] thread '[mir-opt] mir-opt/simplify_if.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:20:18] Current block: None
[01:20:18] Actual Line: "        StorageLive(_1);"
[01:20:18] Expected Line: "    switchInt(const false) -> [false: bb3, otherwise: bb2];"
[01:20:18] Test Name: rustc.main.SimplifyBranches-initial.before.mir
[01:20:18] ... (elided)
[01:20:18] bb0: {
[01:20:18] bb0: {
[01:20:18]     switchInt(const false) -> [false: bb3, otherwise: bb2];
[01:20:18] }
[01:20:18] Actual:
[01:20:18] | User Type Annotations
[01:20:18] | 0: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_if.rs:2:5: 4:6
[01:20:18] | 1: Canonical { max_universe: U0, variables: [], value: Ty(bool) } at /checkout/src/test/mir-opt/simplify_if.rs:2:5: 4:6
[01:20:18] | 2: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: TypeOf(DefId(2/0:4210 ~ core[1e18]::fmt[0]::{{impl}}[2]::new_v1[0]), UserSubsts { substs: [ReLateBound(DebruijnIndex(0), BrAnon(0))], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:4209 ~ core[1e18]::fmt[0]::{{impl}}[2]), self_ty: std::fmt::Arguments<'_> }) }) } at <::std::macros::println macros>:2:29: 2:63
[01:20:18] |
[01:20:18] fn  main() -> () {
[01:20:18]     let mut _0: ();
[01:20:18]     scope 1 {
---
[01:20:18] test result: FAILED. 33 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out
[01:20:18] 
[01:20:18] 
[01:20:18] 
[01:20:18] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:20:18] 
[01:20:18] 
[01:20:18] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:20:18] Build completed unsuccessfully in 0:11:37
[01:20:18] Build completed unsuccessfully in 0:11:37
[01:20:18] make: *** [check] Error 1
[01:20:18] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:314f6e80
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Mar 19 09:59:35 UTC 2019
---
38048 ./obj/build/x86_64-unknown-linux-gnu/doc/core/arch
37776 ./src/llvm-project/lldb/www
369
travis_time:start:055ba66c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:2d2c7476
travis_time:start:2d2c7476
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:02c4fba8
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril

This comment has been minimized.

Copy link
Member Author

commented Mar 19, 2019

(I believe @oli-obk is looking into the mir-opt stuff)

Show resolved Hide resolved src/librustc/hir/mod.rs
Show resolved Hide resolved src/librustc_typeck/check/_match.rs Outdated
Show resolved Hide resolved src/librustc_typeck/check/demand.rs Outdated
Show resolved Hide resolved src/librustc_typeck/check/mod.rs Outdated

Centril added a commit to Centril/rust that referenced this pull request Mar 19, 2019

Rollup merge of rust-lang#59290 - oli-obk:trivial_move_prop, r=davidtwco
Run branch cleanup after copy prop

This is preliminary work for rust-lang#59288 (comment) which gets rid of `if` in the HIR.

cc @rust-lang/wg-mir-opt 	@Centril
@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

⌛️ Trying commit db4452f with merge bf82f43...

bors added a commit that referenced this pull request Mar 19, 2019

Auto merge of #59288 - Centril:hir-if-to-match, r=<try>
[WIP] [let_chains, 1/6] Remove hir::ExprKind::If

Per #53667 (comment).

r? @oli-obk
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Mar 19, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:088c3fab:start=1553004815623237758,finish=1553004817893658865,duration=2270421107
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
travis_time:start:test_incremental
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:26:31] 
[01:26:31] running 99 tests
[01:26:49] ............................F......................................................................
[01:26:49] 
[01:26:49] ---- [incremental] incremental/hashes/if_expressions.rs stdout ----
[01:26:49] 
[01:26:49] 
[01:26:49] error in revision `cfail2`: test compilation failed although it shouldn't!
[01:26:49] status: exit code: 1
[01:26:49] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/incremental/hashes/if_expressions.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "cfail2" "-C" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions/if_expressions.inc" "-Z" "incremental-verify-ich" "-Z" "incremental-queries" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "query-dep-graph" "-Zincremental-ignore-spans" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions/auxiliary"
[01:26:49] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:26:49] ------------------------------------------
[01:26:49] 
[01:26:49] ------------------------------------------
[01:26:49] ------------------------------------------
[01:26:49] stderr:
[01:26:49] ------------------------------------------
[01:26:49] {"message":"`MirBuilt(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":2046,"byte_end":2166,"line_start":99,"line_end":108,"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 = 2;","highlight_start":1,"highlight_end":17},{"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,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `MirBuilt(add_else_branch)` should be clean but is not\n  --> /checkout/src/test/incremental/hashes/if_expressions.rs:99:1\n   |\nLL | / pub fn add_else_branch(x: bool) -> u32 {\nLL | |     let mut ret = 1;\nLL | |\nLL | |     if x {\n...  |\nLL | |     ret\nLL | | }\n   | |_^\n\n"}
[01:26:49] {"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":2046,"byte_end":2166,"line_start":99,"line_end":108,"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 = 2;","highlight_start":1,"highlight_end":17},{"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,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `MirOptimized(add_else_branch)` should be clean but is not\n  --> /checkout/src/test/incremental/hashes/if_expressions.rs:99:1\n   |\nLL | / pub fn add_else_branch(x: bool) -> u32 {\nLL | |     let mut ret = 1;\nLL | |\nLL | |     if x {\n...  |\nLL | |     ret\nLL | | }\n   | |_^\n\n"}
[01:26:49] 
[01:26:49] ------------------------------------------
[01:26:49] 
[01:26:49] thread '[incremental] incremental/hashes/if_expressions.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3325:9
---
[01:26:49] test result: FAILED. 98 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[01:26:49] 
[01:26:49] 
[01:26:49] 
[01:26:49] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/incremental" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "incremental" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:26:49] 
[01:26:49] 
[01:26:49] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:26:49] Build completed unsuccessfully in 0:12:36
[01:26:49] Build completed unsuccessfully in 0:12:36
[01:26:49] make: *** [check] Error 1
[01:26:49] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0c6a8b99
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Mar 19 15:40:39 UTC 2019
---
travis_time:end:142ba908:start=1553010040714916608,finish=1553010040720194209,duration=5277601
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0433b918
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:169dca1d
travis_time:start:169dca1d
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0efafdd1
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

☀️ Try build successful - checks-travis
Build commit: bf82f43

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@rust-timer build

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@rust-timer

This comment has been minimized.

Copy link

commented Mar 19, 2019

Success: Queued bf82f43 with parent ef4d1c4, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

commented Mar 19, 2019

Finished benchmarking try commit bf82f43

@Centril Centril force-pushed the Centril:hir-if-to-match branch 2 times, most recently from 772ab34 to 9a0d37d Mar 21, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Mar 21, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0411d58d:start=1553163138159544649,finish=1553163140455676211,duration=2296131562
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:21:17] 
[01:21:17] running 9 tests
[01:21:17] iiiiiiiii
[01:21:17] 
[01:21:17]  finished in 0.155
[01:21:17] travis_fold:end:test_assembly


[01:21:17] travis_time:end:test_assembly:start=1553168029677958874,finish=1553168029833541815,duration=155582941

[01:21:17] travis_fold:start:test_incremental
travis_time:start:test_incremental
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:21:18] 
[01:21:18] running 99 tests
[01:21:33] ............................F......................................................................
[01:21:33] failures:
[01:21:33] 
[01:21:33] ---- [incremental] incremental/hashes/if_expressions.rs stdout ----
[01:21:33] 
[01:21:33] 
[01:21:33] error in revision `cfail2`: test compilation failed although it shouldn't!
[01:21:33] status: exit code: 1
[01:21:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/incremental/hashes/if_expressions.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "cfail2" "-C" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions/if_expressions.inc" "-Z" "incremental-verify-ich" "-Z" "incremental-queries" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "query-dep-graph" "-Zincremental-ignore-spans" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/hashes/if_expressions/auxiliary"
[01:21:33] ------------------------------------------
[01:21:33] 
[01:21:33] ------------------------------------------
[01:21:33] stderr:
[01:21:33] stderr:
[01:21:33] ------------------------------------------
[01:21:33] {"message":"`MirBuilt(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":2046,"byte_end":2166,"line_start":99,"line_end":108,"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 = 2;","highlight_start":1,"highlight_end":17},{"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,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `MirBuilt(add_else_branch)` should be clean but is not\n  --> /checkout/src/test/incremental/hashes/if_expressions.rs:99:1\n   |\nLL | / pub fn add_else_branch(x: bool) -> u32 {\nLL | |     let mut ret = 1;\nLL | |\nLL | |     if x {\n...  |\nLL | |     ret\nLL | | }\n   | |_^\n\n"}
[01:21:33] {"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":2046,"byte_end":2166,"line_start":99,"line_end":108,"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 = 2;","highlight_start":1,"highlight_end":17},{"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,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `MirOptimized(add_else_branch)` should be clean but is not\n  --> /checkout/src/test/incremental/hashes/if_expressions.rs:99:1\n   |\nLL | / pub fn add_else_branch(x: bool) -> u32 {\nLL | |     let mut ret = 1;\nLL | |\nLL | |     if x {\n...  |\nLL | |     ret\nLL | | }\n   | |_^\n\n"}
[01:21:33] 
[01:21:33] ------------------------------------------
[01:21:33] 
[01:21:33] thread '[incremental] incremental/hashes/if_expressions.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3369:9
---
[01:21:33] test result: FAILED. 98 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[01:21:33] 
[01:21:33] 
[01:21:33] 
[01:21:33] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/incremental" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "incremental" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:21:33] 
[01:21:33] 
[01:21:33] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:21:33] Build completed unsuccessfully in 0:11:57
[01:21:33] Build completed unsuccessfully in 0:11:57
[01:21:33] Makefile:48: recipe for target 'check' failed
[01:21:33] make: *** [check] Error 1
3025876 ./obj
3010728 ./obj/build
2338516 ./obj/build/x86_64-unknown-linux-gnu
1369712 ./src
---
146824 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu
146820 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release
143328 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps
142476 ./obj/build/bootstrap/debug/incremental/bootstrap-5f86g9tk67ex
142472 ./obj/build/bootstrap/debug/incremental/bootstrap-5f86g9tk67ex/s-fajtd9pqah-1513kbz-1vb7uucvhhcds
137196 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu
137192 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release
134380 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps
123632 ./src/llvm-project/llvm/test/CodeGen

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Mar 22, 2019

☔️ The latest upstream changes (presumably #58981) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril force-pushed the Centril:hir-if-to-match branch from c6eac6a to f9cc5a6 May 10, 2019

@Centril

This comment has been minimized.

Copy link
Member Author

commented May 10, 2019

Filed FIXME issue, rebased, and did a minor cleanup after the .await PR.

@oli-obk Please take a look :)

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

📌 Commit f9cc5a6 has been approved by oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

⌛️ Testing commit f9cc5a6 with merge acc7e65...

bors added a commit that referenced this pull request May 10, 2019

Auto merge of #59288 - Centril:hir-if-to-match, r=oli-obk
[let_chains, 1/6] Remove hir::ExprKind::If

Per #53667 (comment).

r? @oli-obk
@bors

This comment has been minimized.

Copy link
Contributor

commented May 11, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing acc7e65 to master...

@bors bors added the merged-by-bors label May 11, 2019

@bors bors merged commit f9cc5a6 into rust-lang:master May 11, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented May 11, 2019

📣 Toolstate changed by #59288!

Tested on commit acc7e65.
Direct link to PR: #59288

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request May 11, 2019

📣 Toolstate changed by rust-lang/rust#59288!
Tested on commit rust-lang/rust@acc7e65.
Direct link to PR: <rust-lang/rust#59288>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).

@Centril Centril deleted the Centril:hir-if-to-match branch May 11, 2019

@Manishearth

This comment has been minimized.

Copy link
Member

commented May 11, 2019

Have you looked into how hard it will be to make clippy migrate to these? We have a lot of lints around ifs, and the lowering may lose some context necessary to make these work. Removing lints because they're no longer possible isn't an option.

IMO for such changes where there's a good chance clippy lints will be unfixably broken we should be notified of this before it merges :/

@Manishearth

This comment has been minimized.

Copy link
Member

commented May 11, 2019

I appreciate it being split up, though, it's easier to make this evaluation if one thing breaks at a time :)

@Centril

This comment has been minimized.

Copy link
Member Author

commented May 11, 2019

We have a lot of lints around ifs, and the lowering may lose some context necessary to make these work.

The lowering preserves information about the source; you can check MatchSource::IfDesugar to see whether it originated from an if.

@oli-obk thought it would work for clippy and as you know, he also works on clippy...

@Manishearth

This comment has been minimized.

Copy link
Member

commented May 11, 2019

@Centril

This comment has been minimized.

Copy link
Member Author

commented May 11, 2019

For the later steps can you work with us to ensure stuff isn't broken before landing? Mostly just pinging me when the PR is ready to merge so I can work on a patch

Sure. Fwiw, I expected Oliver to be the "work with us" party... ;)

The next steps will be to introduce ast::ExprKind::Let and then to use 'label: { ... break 'label value }. That will probably be less straightforward but I think we can introduce similar desugaring info as needed. I could introduce ast::ExprKind::Let in a separate intermediate step however without connecting the parser (already done in a PR but I could probably split things).

@Manishearth Manishearth referenced this pull request May 11, 2019

Merged

Rustup to rustc 1.36.0-nightly (acc7e652f 2019-05-10) #4080

5 of 5 tasks complete
@Manishearth

This comment has been minimized.

Copy link
Member

commented May 11, 2019

bors added a commit to rust-lang/rust-clippy that referenced this pull request May 11, 2019

Auto merge of #4080 - rust-lang:rustup, r=oli-obk
Rustup to rustc 1.36.0-nightly (acc7e652f 2019-05-10)

Fixes breakages from rust-lang/rust#59288

Not finished yet, help appreciated.

Todo:

 - [x] Needs to build
 - [x] Util should handle DropTemps, #4080 (comment)
 - [x] Author lint should spit out higher::if_block checks
 - [x] Unsure what to do in consts.rs
 - [x] Needs to pass tests

bors added a commit that referenced this pull request May 15, 2019

Auto merge of #60861 - Centril:let-chains-ast-intro, r=<try>
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk

bors added a commit that referenced this pull request May 16, 2019

Auto merge of #60861 - Centril:let-chains-ast-intro, r=<try>
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk

bors added a commit that referenced this pull request May 16, 2019

Auto merge of #60861 - Centril:let-chains-ast-intro, r=<try>
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk

bors added a commit that referenced this pull request May 19, 2019

Auto merge of #60861 - Centril:let-chains-ast-intro, r=<try>
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk
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.