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, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains #60861

Merged
merged 35 commits into from Jun 23, 2019

Conversation

@Centril
Copy link
Member

commented May 15, 2019

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
  • 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

Show resolved Hide resolved src/libsyntax/parse/parser.rs Outdated
@Manishearth

This comment was marked as resolved.

Copy link
Member

commented May 15, 2019

We should probably hold off on landing this till the RLS issues are fixed #60848 (comment)

But we can start on the clippyup now.

@Centril

This comment was marked as resolved.

Copy link
Member Author

commented May 15, 2019

@Manishearth Sounds good; we are (soon? or right now?) in the no-toolstate-breakage window anyways?

Oliver also needs his time to review. =P

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented May 15, 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:0c9ba85a:start=1557947779173160435,finish=1557947865583312279,duration=86410151844
$ 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
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:04:05] tidy error: /checkout/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs:12: trailing whitespace
[00:04:10] some tidy checks failed
[00:04:10] 
[00:04:10] 
[00:04:10] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:10] 
[00:04:10] 
[00:04:10] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:10] Build completed unsuccessfully in 0:01:11
[00:04:10] Build completed unsuccessfully in 0:01:11
[00:04:10] make: *** [tidy] Error 1
[00:04:10] Makefile:67: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0e797c74
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed May 15 19:22:05 UTC 2019
---
travis_time:end:01528e76:start=1557948126119363608,finish=1557948126123942734,duration=4579126
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2546ad44
$ 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:36693200
travis_time:start:36693200
$ 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:02656b2d
$ 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 Centril force-pushed the Centril:let-chains-ast-intro branch from 699b699 to d5a1621 May 15, 2019

@petrochenkov petrochenkov self-assigned this May 15, 2019

@Manishearth

This comment was marked as resolved.

Copy link
Member

commented May 15, 2019

@bors try

I want a rustuppable commit

@bors

This comment was marked as resolved.

Copy link
Contributor

commented May 15, 2019

⌛️ Trying commit d5a1621 with merge 793461e...

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
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented May 15, 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:113691a8:start=1557949112234241692,finish=1557949198712449055,duration=86478207363
$ 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
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:52:54]    Compiling rand_isaac v0.1.1
[00:52:54]    Compiling rand_hc v0.1.0
[00:52:54]    Compiling rand_xorshift v0.1.0
[00:52:55]    Compiling minifier v0.0.30
[00:52:55] error: local ambiguity: multiple parsing options: built-in NTs expr ('else_cond') or 1 other option.
[00:52:55]    --> /cargo/registry/src/github.com-1ecc6299db9ec823/minifier-0.0.30/src/css/token.rs:564:17
[00:52:55]     |
[00:52:55] 564 |                 let Ok(op) = Operator::try_from(c) => {
[00:52:55] 
[00:52:55] error: aborting due to previous error
[00:52:55] 
[00:52:55] error: Could not compile `minifier`.

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 May 15, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented May 15, 2019

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:105dd9d1
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[01:14:56]    Compiling unicase v2.3.0
[01:14:57]    Compiling owning_ref v0.3.3
[01:14:57]    Compiling minifier v0.0.30
[01:14:57]    Compiling smallvec v0.6.7
[01:14:57] error: local ambiguity: multiple parsing options: built-in NTs expr ('else_cond') or 1 other option.
[01:14:57]    --> /cargo/registry/src/github.com-1ecc6299db9ec823/minifier-0.0.30/src/css/token.rs:564:17
[01:14:57]     |
[01:14:57] 564 |                 let Ok(op) = Operator::try_from(c) => {
[01:14:57] 
[01:14:57] error: aborting due to previous error
[01:14:57] 
[01:14:57] error: Could not compile `minifier`.
---
travis_time:end:0b2418a8:start=1557955996767683942,finish=1557955996782308675,duration=14624733
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0e748ea7
$ 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:10ee3136
travis_time:start:10ee3136
$ 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:0dd3e628
$ 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)

@Manishearth

This comment was marked as outdated.

Copy link
Member

commented May 15, 2019

Uh, once you know it's passing please kick off a try build. I might just build it locally, but it's easier for clippy folks to collab if we can just rustup-toolchain-install-master it

@Centril

This comment was marked as outdated.

Copy link
Member Author

commented May 16, 2019

@bors

This comment was marked as outdated.

Copy link
Contributor

commented May 16, 2019

⌛️ Trying commit b840eb1 with merge 65061e7...

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

This comment was marked as outdated.

Copy link
Contributor

commented May 16, 2019

💥 Test timed out

@Centril

This comment was marked as outdated.

Copy link
Member Author

commented May 16, 2019

@bors try

@pietroalbini

This comment was marked as outdated.

Copy link
Member

commented May 16, 2019

@bors try

@pietroalbini

This comment was marked as outdated.

Copy link
Member

commented May 16, 2019

@bors try please

@Centril

This comment was marked as outdated.

Copy link
Member Author

commented May 16, 2019

@bors are you still there?

@bors

This comment was marked as outdated.

Copy link
Contributor

commented May 16, 2019

🍰 Target acquired

@Centril Centril force-pushed the Centril:let-chains-ast-intro branch from 3f95f49 to c75f7ec Jun 23, 2019

@Centril Centril referenced this pull request Jun 23, 2019

Merged

Remove `ast::Guard` #62075

bors added a commit that referenced this pull request Jun 23, 2019

Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkov
Remove `ast::Guard`

With the introduction of `ast::ExprKind::Let` in #60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](#51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.

However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).

r? @petrochenkov
@petrochenkov

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

📌 Commit c75f7ec has been approved by petrochenkov

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

⌛️ Testing commit c75f7ec with merge 5d677b2...

bors added a commit that referenced this pull request Jun 23, 2019

Auto merge of #60861 - Centril:let-chains-ast-intro, r=petrochenkov
[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
+ 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

Centril added a commit to Centril/rust that referenced this pull request Jun 23, 2019

Rollup merge of rust-lang#62075 - Centril:guardless-match-arms, r=pet…
…rochenkov

Remove `ast::Guard`

With the introduction of `ast::ExprKind::Let` in rust-lang#60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](rust-lang#51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.

However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).

r? @petrochenkov
@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: petrochenkov
Pushing 5d677b2 to master...

@bors bors added the merged-by-bors label Jun 23, 2019

@bors bors merged commit c75f7ec into rust-lang:master Jun 23, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
pr Build #20190623.6 succeeded
Details

@Centril Centril deleted the Centril:let-chains-ast-intro branch Jun 23, 2019

bors added a commit that referenced this pull request Jun 24, 2019

Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkov
Remove `ast::Guard`

With the introduction of `ast::ExprKind::Let` in #60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](#51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.

However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).

r? @petrochenkov

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

Auto merge of #4123 - Centril:rustup-let-chains-ast, r=Manishearth
Fix fallout from rust-lang/rust PR 60861

Fixes incoming breakage for unlanded rust-lang/rust#60861.

Tests are passing locally; the Rust PR now needs to land first.

@Manishearth also says we'll want to split out to a `collapsible_if_let` once we have let-chains working in Rust nightly or something.
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.