Commit Graph

11 Commits

Author SHA1 Message Date
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