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

refactor expr & stmt parsing + improve recovery #66994

Merged
merged 34 commits into from Dec 21, 2019
Merged

Conversation

@Centril
Copy link
Member

Centril commented Dec 3, 2019

Summary of important changes (best read commit-by-commit, ignoring whitespace changes):

  • AttrVec is introduces as an alias for ThinVec<Attribute>
  • parse_expr_bottom and parse_stmt are thoroughly refactored.
  • Extract diagnostics logic for vec![...] in a pattern context.
  • Recovery is added for do catch { ... }
  • Recovery is added for 'label: non_block_expr
  • Recovery is added for var $local, auto $local, and mut $local. Fixes #65257.
  • Recovery is added for e1 and e2 and e1 or e2.
  • macro_legacy_warnings is turned into an error (has been a warning for 3 years!)
  • Fixes #63396 by forward-porting #64105 which now works thanks to added recovery.
  • ui-fulldeps/ast_stmt_expr_attr.rs is turned into UI and pretty tests.
  • Recovery is fixed for #[attr] if expr {}

r? @estebank

@Centril Centril force-pushed the Centril:stmt-polish branch from 90a3771 to a5ab384 Dec 3, 2019
@petrochenkov petrochenkov self-assigned this Dec 3, 2019
@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Dec 3, 2019

Looking at some more changes to expr.rs right now because it's still a mess. :(
Will make those changes as a different PR based on this one tho.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 3, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-12-03T18:20:58.9105496Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-03T18:20:58.9121437Z ##[command]git config gc.auto 0
2019-12-03T18:20:58.9125093Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-03T18:20:58.9130042Z ##[command]git config --get-all http.proxy
2019-12-03T18:20:58.9136220Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66994/merge:refs/remotes/pull/66994/merge
---
2019-12-03T19:21:41.6351605Z .................................................................................................... 1600/9324
2019-12-03T19:21:46.4400508Z .................................................................................................... 1700/9324
2019-12-03T19:21:59.1231835Z ........................................i........................................................... 1800/9324
2019-12-03T19:22:07.0619189Z .................................................................................................... 1900/9324
2019-12-03T19:22:20.7901557Z .........................iiiii...................................................................... 2000/9324
2019-12-03T19:22:31.2338009Z .................................................................................................... 2200/9324
2019-12-03T19:22:33.9397588Z .................................................................................................... 2300/9324
2019-12-03T19:22:38.6644542Z .................................................................................................... 2400/9324
2019-12-03T19:23:00.5385288Z .................................................................................................... 2500/9324
---
2019-12-03T19:25:43.7734031Z ..........................i...............i......................................................... 4800/9324
2019-12-03T19:25:54.6615257Z .................................................................................................... 4900/9324
2019-12-03T19:26:00.7352383Z .................................................................................................... 5000/9324
2019-12-03T19:26:09.2496856Z .................................................................................................... 5100/9324
2019-12-03T19:26:17.0203510Z ................................ii.ii...........i................................................... 5200/9324
2019-12-03T19:26:26.7096457Z .................................................................................................... 5400/9324
2019-12-03T19:26:36.9382774Z .................................................................................................... 5500/9324
2019-12-03T19:26:44.3516718Z ..............i..................................................................................... 5600/9324
2019-12-03T19:26:50.7666724Z .................................................................................................... 5700/9324
2019-12-03T19:26:50.7666724Z .................................................................................................... 5700/9324
2019-12-03T19:27:01.9991380Z ...................................................................................................i 5800/9324
2019-12-03T19:27:14.2773518Z i...i..ii...........i............................................................................... 5900/9324
2019-12-03T19:27:33.0315303Z .................................................................................................... 6100/9324
2019-12-03T19:27:40.7380754Z .................................................................................................... 6200/9324
2019-12-03T19:27:40.7380754Z .................................................................................................... 6200/9324
2019-12-03T19:27:56.0887306Z ......................i..ii......................................................................... 6300/9324
2019-12-03T19:28:16.2598866Z ..............................................................................................i..... 6500/9324
2019-12-03T19:28:18.6896160Z .................................................................................................... 6600/9324
2019-12-03T19:28:21.0798700Z .......................................................................................i............ 6700/9324
2019-12-03T19:28:23.9380277Z .................................................................................................... 6800/9324
---
2019-12-03T19:30:05.8383498Z .................................................................................................... 7400/9324
2019-12-03T19:30:11.4889884Z .................................................................................................... 7500/9324
2019-12-03T19:30:17.8552930Z .................................................................................................... 7600/9324
2019-12-03T19:30:29.2124899Z .................................................................................................... 7700/9324
2019-12-03T19:30:35.7430438Z ..iiii.............................................................................................. 7800/9324
2019-12-03T19:30:45.5477378Z ................................ii......i........................................................... 7900/9324
2019-12-03T19:31:02.3408323Z .................................................................................................... 8100/9324
2019-12-03T19:31:15.1825730Z .................................................................................................... 8200/9324
2019-12-03T19:31:21.6870807Z .................................................................................................... 8300/9324
2019-12-03T19:31:43.2773830Z .................................................................................................... 8400/9324
---
2019-12-03T19:33:43.3272517Z  finished in 6.373
2019-12-03T19:33:43.3476070Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-12-03T19:33:44.1749463Z 
2019-12-03T19:33:44.1840109Z running 164 tests
2019-12-03T19:33:46.6261658Z iiii....iii......iii..iiii...i.............................i..i..................i....i...........ii 100/164
2019-12-03T19:33:48.6766173Z .i.i..iiii..iiiiiii............i.........iii.i..........ii......
2019-12-03T19:33:48.6816807Z 
2019-12-03T19:33:48.6816889Z  finished in 5.304
2019-12-03T19:33:48.6817215Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-12-03T19:33:48.8545679Z 
---
2019-12-03T19:33:50.8691977Z  finished in 2.195
2019-12-03T19:33:50.8905127Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-12-03T19:33:51.6818977Z 
2019-12-03T19:33:51.6829783Z running 9 tests
2019-12-03T19:33:51.6870002Z iiiiiiiii
2019-12-03T19:33:51.6870876Z 
2019-12-03T19:33:51.6871305Z  finished in 0.182
2019-12-03T19:33:51.6871736Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-12-03T19:33:51.6909454Z 
---
2019-12-03T19:34:11.0906674Z  finished in 19.996
2019-12-03T19:34:11.1142442Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-12-03T19:34:11.6853845Z 
2019-12-03T19:34:11.6858882Z running 124 tests
2019-12-03T19:34:36.6528229Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i....ii...i.......ii 100/124
2019-12-03T19:34:41.9578809Z .i.i.i......iii.i.....ii
2019-12-03T19:34:41.9582998Z 
2019-12-03T19:34:41.9583057Z  finished in 30.844
2019-12-03T19:34:41.9593274Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-12-03T19:34:41.9593732Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-12-03T19:35:25.6493696Z 
2019-12-03T19:35:25.6494058Z ------------------------------------------
2019-12-03T19:35:25.6494237Z stderr:
2019-12-03T19:35:25.6494606Z ------------------------------------------
2019-12-03T19:35:25.6495117Z error: an inner attribute is not permitted in this context
2019-12-03T19:35:25.6495504Z  --> <box #![attr] 0>:1:5
2019-12-03T19:35:25.6495722Z   |
2019-12-03T19:35:25.6495965Z 1 | box #![attr] 0
2019-12-03T19:35:25.6496532Z   |
2019-12-03T19:35:25.6496532Z   |
2019-12-03T19:35:25.6496674Z   = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
2019-12-03T19:35:25.6496952Z error: an inner attribute is not permitted in this context
2019-12-03T19:35:25.6496952Z error: an inner attribute is not permitted in this context
2019-12-03T19:35:25.6497290Z  --> <foo(#![attr])>:1:5
2019-12-03T19:35:25.6497479Z   |
2019-12-03T19:35:25.6497599Z 1 | foo(#![attr])
2019-12-03T19:35:25.6497851Z   |
2019-12-03T19:35:25.6497851Z   |
2019-12-03T19:35:25.6497990Z   = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
2019-12-03T19:35:25.6498259Z error: expected expression, found `)`
2019-12-03T19:35:25.6498259Z error: expected expression, found `)`
2019-12-03T19:35:25.6498567Z  --> <foo(#![attr])>:1:13
2019-12-03T19:35:25.6498737Z   |
2019-12-03T19:35:25.6498880Z 1 | foo(#![attr])
2019-12-03T19:35:25.6499101Z 
2019-12-03T19:35:25.6499239Z error: an inner attribute is not permitted in this context
2019-12-03T19:35:25.6499239Z error: an inner attribute is not permitted in this context
2019-12-03T19:35:25.6499542Z  --> <x.foo(#![attr])>:1:7
2019-12-03T19:35:25.6499724Z   |
2019-12-03T19:35:25.6499864Z 1 | x.foo(#![attr])
2019-12-03T19:35:25.6500093Z   |
2019-12-03T19:35:25.6500093Z   |
2019-12-03T19:35:25.6500249Z   = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
2019-12-03T19:35:25.6500480Z error: unexpected token: `#`
2019-12-03T19:35:25.6500480Z error: unexpected token: `#`
2019-12-03T19:35:25.6500817Z  --> <x.#[attr]foo()>:1:3
2019-12-03T19:35:25.6500977Z   |
2019-12-03T19:35:25.6501092Z 1 | x.#[attr]foo()
2019-12-03T19:35:25.6501328Z 
2019-12-03T19:35:25.6501454Z error: unexpected token: `#`
2019-12-03T19:35:25.6501454Z error: unexpected token: `#`
2019-12-03T19:35:25.6501773Z  --> <x.#![attr]foo()>:1:3
2019-12-03T19:35:25.6501931Z   |
2019-12-03T19:35:25.6502046Z 1 | x.#![attr]foo()
2019-12-03T19:35:25.6502283Z 
2019-12-03T19:35:25.6502863Z error: expected expression, found `)`
2019-12-03T19:35:25.6502863Z error: expected expression, found `)`
2019-12-03T19:35:25.6503350Z  --> <#[attr] (#![attr])>:1:18
2019-12-03T19:35:25.6503548Z   |
2019-12-03T19:35:25.6503679Z 1 | #[attr] (#![attr])
2019-12-03T19:35:25.6503955Z 
2019-12-03T19:35:25.6503955Z 
2019-12-03T19:35:25.6504633Z thread 'main' panicked at 'parse error: Diagnostic { level: Fatal, message: [("parse error", NoStyle)], code: None, span: MultiSpan { primary_spans: [Span { lo: BytePos(17), hi: BytePos(18), ctxt: #0 }], span_labels: [] }, children: [], suggestions: [], sort_span: Span { lo: BytePos(17), hi: BytePos(18), ctxt: #0 } }', src/libcore/result.rs:1189:5
2019-12-03T19:35:25.6505039Z 
2019-12-03T19:35:25.6505423Z ------------------------------------------
2019-12-03T19:35:25.6505589Z 
2019-12-03T19:35:25.6505707Z 
---
2019-12-03T19:35:25.6507157Z test result: FAILED. 64 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
2019-12-03T19:35:25.6507311Z 
2019-12-03T19:35:25.6513201Z 
2019-12-03T19:35:25.6513445Z 
2019-12-03T19:35:25.6519342Z 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/ui-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--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 -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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"
2019-12-03T19:35:25.6521152Z 
2019-12-03T19:35:25.6521180Z 
2019-12-03T19:35:25.6529256Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-03T19:35:25.6529350Z Build completed unsuccessfully in 1:08:09
2019-12-03T19:35:25.6529350Z Build completed unsuccessfully in 1:08:09
2019-12-03T19:35:25.6586558Z == clock drift check ==
2019-12-03T19:35:25.6607030Z   local time: Tue Dec  3 19:35:25 UTC 2019
2019-12-03T19:35:25.7221257Z   network time: Tue, 03 Dec 2019 19:35:25 GMT
2019-12-03T19:35:25.7224881Z == end clock drift check ==
2019-12-03T19:35:27.2209118Z 
2019-12-03T19:35:27.2327432Z ##[error]Bash exited with code '1'.
2019-12-03T19:35:27.2369796Z ##[section]Starting: Checkout
2019-12-03T19:35:27.2371752Z ==============================================================================
2019-12-03T19:35:27.2371803Z Task         : Get sources
2019-12-03T19:35:27.2371881Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

LL | let a = #![allow(warnings)] (1, 2);
| ^^^^^^^^^^^^^^^^^^^
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

We don't have a style guide covering this yet, but this mix&match of lowercase led sentence followed by properly capitalized sentence is jarring to me. In other errors I've sidestepped the issue by issuing two notes or reworking the text to work as a single sentence.

This comment has been minimized.

Copy link
@Centril

Centril Dec 4, 2019

Author Member

Well it's pre-existing and I would prefer not to do anything about it here, but maybe you want to file an issue for this or something. :)

let a = #![allow(warnings)] (1, 2);
//~^ ERROR an inner attribute is not permitted in this context

let b = (#![allow(warnings)] 1, 2);

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

These other cases should also be emitting warnings, right?

This comment has been minimized.

Copy link
@Centril

Centril Dec 4, 2019

Author Member

Well warnings are being allowed so that doesn't seem right. The point of this test is only parsing behavior tho, not the lint system.

--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
|
LL | let _ = a or b;
| ^^ help: instead of `or`, use `||` to perform logical disjunction: `||`

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

"logical conjuction/disjunction" makes sense and is accurate, but it's not very friendly to most people, who will most likely need to do a double take to understand what it means (if we reword in a more terse manner as suggested above).

This comment has been minimized.

Copy link
@Centril

Centril Dec 4, 2019

Author Member

I'm not sure what a less jargon-y wording would be. At least "logical conjunction" is easy to google for.

@@ -426,11 +410,11 @@ impl<'a> Parser<'a> {
}

/// Parses a statement, including the trailing semicolon.
pub fn parse_full_stmt(&mut self, macro_legacy_warnings: bool) -> PResult<'a, Option<Stmt>> {
pub fn parse_full_stmt(&mut self) -> PResult<'a, Option<Stmt>> {

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

@petrochenkov you'll want to take a look at the changes in this file.

.span_label(self.token.span, msg)
.emit();
// Continue as an expression in an effort to recover on `'label: non_block_expr`.
self.parse_expr()

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

Should this use the snapshotting hack to to try and keep the error count down? There are cases where error recovery is too eager and we end up with wall of texts on a single typo :-/

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

To be clear, this is fine as is, just something to consider when working on this code doing these kind of things. If an expression can't be parsed, at that point it is nicer to just give up and raise FatalError.

This comment has been minimized.

Copy link
@Centril

Centril Dec 4, 2019

Author Member

Imo not worth it until more people complain :)

This comment has been minimized.

Copy link
@estebank

estebank Dec 6, 2019

Contributor

What if I'm the one complaining about the output I'm seeing? :^)

This comment has been minimized.

Copy link
@Centril

Centril Dec 6, 2019

Author Member

Are you tho? ;)

&format!("expected `;`, found {}", self.this_token_descr())
}).note({
"this was erroneously allowed and will become a hard error in a future release"
}).emit();

This comment has been minimized.

Copy link
@estebank

estebank Dec 4, 2019

Contributor

Where did this go? We can't suddenly start rejecting code, even if we were unconditionally warning on it.

This comment has been minimized.

Copy link
@Centril

Centril Dec 4, 2019

Author Member

It was always intended to become an error eventually and has been a warning for 3 years, so I figured we can turn it into a hard error by now.

This comment has been minimized.

Copy link
@estebank

estebank Dec 6, 2019

Contributor

SGTM, make sure to run crater :)

This comment has been minimized.

Copy link
@estebank

estebank Dec 6, 2019

Contributor

SGTM, make sure to run crater :)

This comment has been minimized.

Copy link
@Centril

Centril Dec 6, 2019

Author Member

I'll remove it from the PR for now so we don't have to wait for crater and so I don't have to rebase. I've filed #67098 as a reminder.

This comment has been minimized.

Copy link
@Centril

Centril Dec 6, 2019

Author Member

Done.

Copy link
Contributor

estebank left a comment

LGTM, besides my prior comments

@Centril Centril force-pushed the Centril:stmt-polish branch from 309a252 to 49d6770 Dec 4, 2019
@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Dec 6, 2019

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

@petrochenkov petrochenkov removed their assignment Dec 6, 2019
@Centril Centril force-pushed the Centril:stmt-polish branch from 49d6770 to 9516f93 Dec 6, 2019
@Centril Centril force-pushed the Centril:stmt-polish branch from 9516f93 to 01d552d Dec 6, 2019
@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Dec 6, 2019

Rebased & dropped the legacy warning stuff for a future PR.

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Dec 7, 2019

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

@Centril Centril force-pushed the Centril:stmt-polish branch from 01d552d to 9df9d6a Dec 7, 2019
@JohnCSimon

This comment was marked as outdated.

Copy link
Member

JohnCSimon commented Dec 14, 2019

Ping from triage:
@estebank - it looks like this PR is ready for review.

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Dec 20, 2019

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

@Centril Centril force-pushed the Centril:stmt-polish branch from 9df9d6a to 621661f Dec 20, 2019
@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Dec 20, 2019

Rebased. :)

LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators

This comment has been minimized.

Copy link
@estebank

estebank Dec 21, 2019

Contributor

I don't know if the note calling out python and PHP here is a good idea.

This comment has been minimized.

Copy link
@Centril

Centril Dec 21, 2019

Author Member

I debated this with myself a few times but in the end I thought that habits from python (PHP less so) would be the most likely source of using and so it felt like relevant information for such users.

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Dec 21, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 21, 2019

📌 Commit 621661f has been approved by estebank

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 21, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Dec 21, 2019

@bors p=199

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 21, 2019

⌛️ Testing commit 621661f with merge c64eecf...

bors added a commit that referenced this pull request Dec 21, 2019
refactor expr & stmt parsing + improve recovery

Summary of important changes (best read commit-by-commit, ignoring whitespace changes):

- `AttrVec` is introduces as an alias for `ThinVec<Attribute>`
- `parse_expr_bottom` and `parse_stmt` are thoroughly refactored.
- Extract diagnostics logic for `vec![...]` in a pattern context.
- Recovery is added for `do catch { ... }`
- Recovery is added for `'label: non_block_expr`
- Recovery is added for `var $local`, `auto $local`, and `mut $local`. Fixes #65257.
- Recovery is added for `e1 and e2` and `e1 or e2`.
- ~~`macro_legacy_warnings` is turned into an error (has been a warning for 3 years!)~~
- Fixes #63396 by forward-porting #64105 which now works thanks to added recovery.
- `ui-fulldeps/ast_stmt_expr_attr.rs` is turned into UI and pretty tests.
- Recovery is fixed for `#[attr] if expr {}`

r? @estebank
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 21, 2019

☀️ Test successful - checks-azure
Approved by: estebank
Pushing c64eecf to master...

@bors bors added the merged-by-bors label Dec 21, 2019
@bors bors merged commit 621661f into rust-lang:master Dec 21, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20191220.31 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@Centril Centril deleted the Centril:stmt-polish branch Dec 21, 2019
bors added a commit that referenced this pull request Dec 26, 2019
Refactor expression parsing thoroughly

Based on #66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 26, 2019
Refactor expression parsing thoroughly

Based on rust-lang#66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
bors added a commit that referenced this pull request Dec 27, 2019
Refactor expression parsing thoroughly

Based on #66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
bors added a commit that referenced this pull request Dec 29, 2019
Refactor expression parsing thoroughly

Based on #66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.