Commit graph

2852 commits

Author SHA1 Message Date
Mazdak Farrokhzad
15b5aacab6
Rollup merge of #63146 - Mark-Simulacrum:clean-attr, r=petrochenkov
Cleanup syntax::attr

Mostly removing needless arguments to constructors

r? @petrochenkov
2019-08-03 13:11:59 +02:00
bors
d7270712cb Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centril
Change opaque type syntax from `existential type` to type alias `impl Trait`

This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature.

The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC.

This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063.

r? @Centril
2019-08-03 02:21:23 +00:00
Mazdak Farrokhzad
3396550420
Rollup merge of #63202 - exphp-forks:parser-ice-63135, r=estebank
Fix ICE in #63135

Closes #63135.

r?@estebank
2019-08-02 12:14:21 +02:00
varkor
c28ce3e4ca Replace "existential" by "opaque" 2019-08-02 02:44:36 +01:00
varkor
87738fe834 Switch existential_type to type_alias_impl_trait 2019-08-02 02:44:35 +01:00
Michael Lamparski
b3321fb26e Fix ICE in #63135 2019-08-01 17:34:00 -04:00
Pietro Albini
810ffe2ba0
Rollup merge of #63122 - Centril:fix-63115, r=petrochenkov
Account for `maybe_whole_expr` in range patterns

Fixes https://github.com/rust-lang/rust/issues/63115 (fallout from https://github.com/rust-lang/rust/pull/62550).

r? @petrochenkov
2019-08-01 16:00:26 +02:00
Mazdak Farrokhzad
6551285cca Address review comments. 2019-07-31 21:25:11 +02:00
Mark Rousskov
c9bd4a05bf Replace a few Attribute constructors with mk_attr 2019-07-31 08:55:37 -04:00
Esteban Küber
c82e1f2d0e Point at type ascription before macro invocation on expansion parse error 2019-07-30 09:16:27 -07:00
Mazdak Farrokhzad
758931948f Unsupport the await!(..) macro. 2019-07-30 10:55:45 +02:00
Mazdak Farrokhzad
36029878e7
Rollup merge of #62928 - Centril:recover-parens-around-for-head, r=estebank
Syntax: Recover on `for ( $pat in $expr ) $block`

Fixes #62724 by adding some recovery:

```
error: unexpected closing `)`
  --> $DIR/recover-for-loop-parens-around-head.rs:10:23
   |
LL |     for ( elem in vec ) {
   |         --------------^
   |         |
   |         opening `(`
   |         help: remove parenthesis in `for` loop: `elem in vec`
```

The last 2 commits are drive-by cleanups.

r? @estebank
2019-07-30 05:37:32 +02:00
Mazdak Farrokhzad
f3a3290ba3 Account for maybe_whole_expr in range patterns. 2019-07-30 04:22:09 +02:00
Mazdak Farrokhzad
a4cd2ecab2
Rollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasper
Lint attributes on function arguments

Fixes #61238.

cc #60406
2019-07-28 21:19:50 +02:00
Mazdak Farrokhzad
56b39fba56 Add 'span_to_snippet' shortcut. 2019-07-28 20:43:09 +02:00
Mazdak Farrokhzad
1b118607ec Use chaining for diagnosics in parser. 2019-07-28 20:43:09 +02:00
Mazdak Farrokhzad
dfad725be5 Recover 'for ( $pat in $expr ) $block'. 2019-07-28 20:43:09 +02:00
Mazdak Farrokhzad
becdba80ea Address comments in lowering + parsing. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
2f55354759 Recover on 'X..' / 'X..=' / 'X...' range patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
974413fcc5 Recover on '..X' / '..=X' / '...X' range patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
62b29a1e17 Adjust parsing of Slice, Tuple, TupleStruct patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
7e1b671f8a Cleanup using the new parse_*_seq methods. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
7aeb4b7327 Add more parse_*_seq methods for code reuse. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
0a40ef23ad Cleanup parse_seq_* methods + record trailing separators. 2019-07-28 06:53:38 +02:00
Caio
53fc7fbc96 Lint attributes on function arguments 2019-07-27 07:16:21 -03:00
Mazdak Farrokhzad
c9a766ab47
Rollup merge of #62887 - estebank:issue-62881, r=petrochenkov
Make the parser TokenStream more resilient after mismatched delimiter recovery

Fix #62881, fix #62895.
2019-07-25 23:21:03 +02:00
Esteban Küber
fe2b5bbe6d review comments 2019-07-23 12:51:34 -07:00
Esteban Küber
f56c8f6ea4 Fix another case 2019-07-23 11:19:13 -07:00
Esteban Küber
5b3b6b8d00 Make the parser TokenStream more resilient after mismatched delimiter recovery 2019-07-22 18:29:49 -07:00
Esteban Küber
9dbe2e77b3 review comments 2019-07-19 11:36:55 -07:00
Esteban Küber
f5b285906e Handle more cases of typos misinterpreted as type ascription 2019-07-19 10:56:37 -07:00
Mark Rousskov
ae2672340c
Rollup merge of #62666 - estebank:preempt-ice, r=eddyb
Cancel unemitted diagnostics during error recovery

Follow up to https://github.com/rust-lang/rust/pull/62604. Use @eddyb's preferred style and catch other case of the same problem.

r? @eddyb
2019-07-16 11:38:52 -04:00
Mark Rousskov
f9576a6fce
Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebank
Fix #62660

If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE.

Fixes #62660.
2019-07-15 19:55:10 -04:00
bors
e452e2929d Auto merge of #62670 - estebank:extern-fn-with-body, r=petrochenkov
Detect `fn` with a body in an `extern` block

Fix #62109.
2019-07-15 02:13:55 +00:00
bors
d82fd9ecd3 Auto merge of #62643 - estebank:parse-recovery-type-errs, r=petrochenkov
Do not emit type errors after parse error in last statement of block

When recovering from a parse error inside a block, do not emit type
errors generating on that block's recovered return expression.

Fix #57383.
2019-07-14 22:51:05 +00:00
bors
83e4eed16e Auto merge of #62638 - estebank:issue-62554, r=petrochenkov
Use snippet instead of pprinting statement

Fix #62554.
2019-07-14 17:29:17 +00:00
Esteban Küber
c8d9cd99fa Detect fn with a body in an extern block 2019-07-13 22:24:11 -07:00
Jonathan Goodman
7111328556 Don't drop DiagnosticBuilder if parsing fails
If the explicitly given type of a `self` parameter fails to parse correctly,
we need to propagate the error rather than dropping it and causing an ICE.

Fixes #62660.
2019-07-13 19:46:13 -05:00
Esteban Küber
f05dfe07f6 Cancel unemitted diagnostics during error recovery 2019-07-13 16:04:12 -07:00
Mazdak Farrokhzad
4fe6e63cd6
Rollup merge of #62604 - estebank:unemitted-err-ice, r=pnkfelix
Handle errors during error recovery gracefully

Fix #62546.
2019-07-13 16:18:38 +02:00
Esteban Küber
8259a2dd42 Do not emit type errors after parse error in last statement of block
When recovering from a parse error inside a block, do not emit type
errors generating on that block's recovered return expression.

Fix #57383.
2019-07-12 18:55:01 -07:00
Esteban Küber
726aa1437f Use snippet instead of pprinting statement 2019-07-12 14:01:13 -07:00
Mazdak Farrokhzad
a7f1649fbb
Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkov
Correctly break out of recovery loop

Fix #61858.
2019-07-12 22:46:52 +02:00
Esteban Küber
cc481a46cb Correctly break out of recovery loop 2019-07-11 20:02:54 -07:00
Esteban Küber
c9f7a3d206 Emit dropped unemitted errors to aid in ICE debugging 2019-07-11 16:59:19 -07:00
Esteban Küber
e1c7747cf0 Handle errors during error recovery gracefully 2019-07-11 16:54:33 -07:00
Mark Rousskov
63fdf1a527 Remove needless indent arguments
We're always indenting by INDENT_UNIT anyway
2019-07-10 07:13:22 -04:00
Mark Rousskov
cab453250a Move pp::Printer helpers to direct impl 2019-07-10 07:13:20 -04:00
Mazdak Farrokhzad
84527e4676
Rollup merge of #62292 - Centril:split-async-closures, r=cramertj
Move `async || ...` closures into `#![feature(async_closure)]`

The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`.

New tracking issue: https://github.com/rust-lang/rust/issues/62290

Closes https://github.com/rust-lang/rust/issues/62214.

cc https://github.com/rust-lang/rust/issues/62149

r? @varkor
2019-07-05 13:53:06 +02:00
bors
f119bf2761 Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb
Remove io::Result from syntax::print

Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure
2019-07-05 06:55:48 +00:00