Mark Rousskov
998df0d70b
Remove Handler::cancel
2019-09-17 09:30:44 -04:00
Matthew Jasper
5ae3830d58
Give more Idents spans
2019-09-15 09:15:38 +01:00
Caio
63a5f399ae
Resolve attributes in several places
...
Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
2019-09-09 09:27:15 -03:00
Alexander Regueiro
553a56dd98
Apply suggestions from code review
2019-09-07 16:29:04 +01:00
Alexander Regueiro
49d2fd1725
Aggregation of cosmetic changes made during work on REPL PRs: libsyntax
2019-09-07 16:29:04 +01:00
Mazdak Farrokhzad
fae7bc756e
Rollup merge of #64192 - estebank:turbofish-madness, r=petrochenkov
...
Bail out when encountering likely missing turbofish in parser
When encountering a likely intended turbofish without `::`, bubble
up the diagnostic instead of emitting it to allow the parser to recover
more gracefully and avoid uneccessary type errors that are likely to be
wrong.
Fix #61329 .
2019-09-07 08:06:09 +02:00
Mazdak Farrokhzad
afb6a7002d
Rollup merge of #64202 - alexreg:rush-pr-1, r=Centril
...
Fixed grammar/style in some error messages
Factored out from hacking on rustc for work on the REPL.
r? @Centril
2019-09-06 19:00:49 +02:00
Alexander Regueiro
022d9c8eb5
Fixed grammar/style in error messages and reblessed tests.
2019-09-06 03:46:08 +01:00
Esteban Küber
afcf9b262d
Bail out when encountering likely missing turbofish in parser
...
When encountering a likely intended turbofish without `::`, bubble
up the diagnostic instead of emitting it to allow the parser to recover
more gracefully and avoid uneccessary type errors that are likely to be
wrong.
2019-09-05 13:18:05 -07:00
Mazdak Farrokhzad
ad3db726d1
or-patterns: syntax: adjust parser removing a hack.
...
Fuse `parse_top_pat` and `parse_top_pat_unpack` into just `parse_top_pat`.
2019-09-05 08:33:09 +02:00
Nicholas Nethercote
8c74eb7790
Move path parsing earlier.
...
It's a hot enough path that moving it slightly earlier gives a tiny but
easy speedup.
2019-09-03 20:15:07 +10:00
Mazdak Farrokhzad
52c3846d51
Rollup merge of #63945 - Centril:recover-mut-pat, r=estebank
...
Recover `mut $pat` and other improvements
- Recover on e.g. `mut Foo(x, y)` and suggest `Foo(mut x, mut y)`. Fixes https://github.com/rust-lang/rust/issues/63764 .
- Recover on e.g. `let mut mut x;`
- Recover on e.g. `let keyword` and `let keyword(...)`.
- Cleanups in `token.rs` with `fn is_non_raw_ident_where` and friends.
2019-08-29 05:32:48 +02:00
Mazdak Farrokhzad
eb4ac32c59
Rollup merge of #63938 - tshepang:typo, r=Centril
...
or-pattern: fix typo in error message
cc https://github.com/rust-lang/rust/issues/54883 .
2019-08-29 05:32:46 +02:00
Tshepang Lekhonkhobe
6f67bbc445
or-pattern: fix typo in error message
2019-08-28 02:23:58 +02:00
Mazdak Farrokhzad
42e895d4d9
Improve 'mut ' diagnostic.
2019-08-27 23:44:44 +02:00
Mazdak Farrokhzad
dbbe3363c9
Ensure 'let mut ;' where ':pat' is banned.
2019-08-27 19:51:21 +02:00
Kevin Per
e0ce9f8c0a
Cleanup: Consistently use Param instead of Arg #62426
2019-08-27 14:07:41 +02:00
Mazdak Farrokhzad
f908aa9e80
recover on 'mut ' and improve recovery for keywords.
2019-08-27 13:04:48 +02:00
Mazdak Farrokhzad
e49b9581ba
Simplify with Symbol/Token::is_book_lit.
2019-08-27 10:21:41 +02:00
Mazdak Farrokhzad
2bd27fbdfe
parser: fix span for leading vert.
2019-08-26 22:14:31 +02:00
Mazdak Farrokhzad
acb11305e8
parser: TopLevel -> RecoverComma.
2019-08-25 06:15:11 +02:00
Mazdak Farrokhzad
1caaa40768
parser: gracefully handle fn foo(A | B: type).
2019-08-25 05:45:19 +02:00
Mazdak Farrokhzad
083963e58c
parser: 'while parsing this or-pattern...'
2019-08-25 01:50:21 +02:00
Mazdak Farrokhzad
1202cb0e2b
parser: simplify parse_pat_with_or_{inner}
2019-08-25 01:00:19 +02:00
Mazdak Farrokhzad
0ab8430332
parser: reword || recovery.
2019-08-24 23:44:28 +02:00
Mazdak Farrokhzad
e3747722fb
parser: extract recover_inner_leading_vert.
2019-08-24 23:10:46 +02:00
Mazdak Farrokhzad
3a405421e7
parse_top_pat: silence leading vert gating sometimes.
2019-08-24 23:05:04 +02:00
Mazdak Farrokhzad
a9ef8592e4
parser: bool -> TopLevel.
2019-08-24 22:48:23 +02:00
Mazdak Farrokhzad
b2966e651d
parser: bool -> GateOr.
2019-08-24 22:29:57 +02:00
Mazdak Farrokhzad
b205055c7b
parser: better recovery for || in inner pats.
2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
95792b4d5a
parser: let stmts & for exprs: allow or-patterns.
2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
92d66a1317
parser: document parse_pat.
2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
b7178ef983
parser: parse_pats -> parse_top_pat{_unpack}.
2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
8f6a0cdb0f
parser: document ban_unexpected_or_or.
2019-08-24 21:32:49 +02:00
Mazdak Farrokhzad
39f5e5bec4
parser: move maybe_recover_unexpected_comma to a more appropriate place.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
6498959377
parser: use eat_or_separator for leading vert.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
dc5bbaf7b2
parser: improve parse_pat_with_or docs.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
7b59b4f14d
parser: extract eat_or_separator.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
a4a34ab62d
parser: integrate maybe_recover_unexpected_comma in parse_pat_with_or.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
21d9b85c0d
parser: extract maybe_recover_unexpected_comma.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
f852c7ce1c
parser: simplify parse_pat_with_or.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
30b841dce0
parser: improve or-patterns recovery.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
0bbea47794
parser: refactor parse_pat_with_or + use it in [p0, p1, ..] pats.
2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
1ba7550a89
parser: type alias type Expected = Option<&'static str>;.
2019-08-24 21:31:54 +02:00
Mazdak Farrokhzad
5299d8a191
parser: extract ban_unexpected_or_or.
2019-08-24 21:31:54 +02:00
Mazdak Farrokhzad
67e39ed51c
Rollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkov
...
Allow 'default async fn' to parse.
- Parse default async fn. Fixes #63716 .
(`cherry-pick`ed from 3rd commit in https://github.com/rust-lang/rust/pull/63749 .)
r? @petrochenkov
2019-08-21 11:52:25 +02:00
Mazdak Farrokhzad
7ee4f1da8c
Allow 'default async fn' to parse.
2019-08-20 22:57:23 +02:00
Mazdak Farrokhzad
777a12c3a4
Use dedicated type for spans in pre-expansion gating.
2019-08-20 20:26:37 +02:00
Dan Robertson
1870537f27
initial implementation of or-pattern parsing
...
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`.
This is a partial implementation of RFC 2535.
2019-08-17 15:55:40 +00:00
Mazdak Farrokhzad
4087fc583e
Feature gate 'yield ?' pre-expansion.
2019-08-16 19:24:15 +02:00