Commit Graph

24 Commits

Author SHA1 Message Date
Vadim Petrochenkov ff40e37b98 Some code cleanup and tidy/test fixes 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov f745e5f9b6 syntax: Remove duplicate span from token::Ident 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov aa6fba98ae syntax: Use Token in Parser 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov 99b27d749c syntax: Rename Token into TokenKind 2019-06-06 14:03:14 +03:00
Vadim Petrochenkov eac3846b65 Always use token kinds through token module rather than Token type 2019-06-06 14:01:57 +03:00
Eduard-Mihai Burtescu d0c78dd7aa syntax: revert ast::AsyncArgument and associated changes.
Here follows the main reverts applied in order to make this commit:

Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj"

This reverts commit 45b09453db, reversing
changes made to f6df1f6c30.

Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis"

This reverts commit 16939a50ea, reversing
changes made to 12bf981552.

Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj"

This reverts commit 62d1574876, reversing
changes made to 4eff8526a7.
2019-06-03 10:20:35 +01:00
bors c57ed9d947 Auto merge of #61331 - estebank:fn-arg-parse-recovery, r=varkor
Recover gracefully from argument with missing type or param name
2019-06-03 05:40:53 +00:00
Esteban Küber e275f2caf6 Extend docstring 2019-06-01 14:13:57 -07:00
Esteban Küber ad0d3b5d40 Move code from parser to diagnostics 2019-05-30 18:19:48 -07:00
Esteban Küber b3ac88ad92 Recover gracefully from argument with missing type or param name 2019-05-30 17:59:05 -07:00
Janusz Marcinkiewicz 4c5eb8ecfc Explicitly suggest 'type_ascription' feature 2019-05-30 22:44:39 +02:00
Nicholas Nethercote 8ae01a9008 Use Symbol equality in is_ident_named. 2019-05-27 14:05:05 +10:00
Esteban Küber 4e68ddca90 review comments: move back some methods and clean up wording 2019-05-25 12:15:06 -07:00
Esteban Küber d1364d5284 Move some methods to diagnostics.rs away from parser.rs
Move a bunch of error recovery methods to `diagnostics.rs` away from
`parser.rs`.
2019-05-25 12:11:41 -07:00
Esteban Küber 976541884f Tweak self arg not as first argument of a method diagnostic
Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
  --> $DIR/self-in-function-arg.rs:1:15
   |
LL | fn foo(x:i32, self: i32) -> i32 { self }
   |               ^^^^ not valid as function argument
   |
   = note: `self` is only valid as the first argument of an associated function
```

When it is a method, mention it must be first
```
error: unexpected `self` argument in function
  --> $DIR/trait-fn.rs:4:20
   |
LL |     fn c(foo: u32, self) {}
   |                    ^^^^ must be the first associated function argument
```
2019-05-25 12:05:18 -07:00
Esteban Küber ee7593e0ac Revert changes that belong to separate PR 2019-05-24 15:17:32 -07:00
Esteban Küber da57ac38a6 Move diagnostic logic out of parser 2019-05-24 11:50:21 -07:00
Esteban Küber 5c5fa775e5 review comments 2019-05-24 11:50:21 -07:00
Andy Russell 3cbf5864a6 tweak discriminant on non-nullary enum diagnostic
Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.
2019-05-23 11:13:48 -04:00
Vadim Petrochenkov a1885cdba3 Restore the old behavior of the rustdoc keyword check + Fix rebase 2019-05-22 20:20:12 +03:00
Esteban Küber c084d0ed7d review comments 2019-05-16 15:25:58 -07:00
Esteban Küber 4117c6d33c Move some parser recovery methods to diagnostics 2019-05-16 14:31:07 -07:00
Esteban Küber b9d6fe3ae9 Review comments
- Change wording of suggestion
- Move recovery logic to `diagnostics.rs`
- Reduce ammount of code duplication
2019-05-16 13:58:44 -07:00
Andrew Xu d3fff6cda7 move some functions from parser.rs to diagostics.rs
parser.rs is too big. Some functions only for error reporting and error
recovery are being moved to diagostics.rs.
2019-05-01 19:54:48 +08:00