Mazdak Farrokhzad
ae646687e0
Rollup merge of #57364 - hdhoang:33418_negative_bounds, r=estebank
...
Improve parsing diagnostic for negative supertrait bounds
closes #33418
r? @estebank
2019-02-24 05:55:55 +01:00
Mazdak Farrokhzad
18dd2d2fbe
Rollup merge of #58526 - pmccarter:master, r=estebank
...
Special suggestion for illegal unicode curly quote pairs
Fixes #58436
Did not end up expanding the error message span to include the full string literal since I figured the start of the token was the issue, while the help suggestion span would include up to the closing quotation mark.
The look ahead logic does not affect the reader position, not sure if that is an issue (if eg it should still continue to parse after the closing quote without erroring out).
2019-02-23 09:25:27 +01:00
Hoàng Đức Hiếu
7cfddfb4e4
Improve parsing diagnostic for negative supertrait bounds
2019-02-23 07:58:16 +07:00
Mazdak Farrokhzad
894141b57d
Rollup merge of #58198 - igorsdv:suggest-removing-parentheses-surrounding-lifetimes, r=estebank
...
Suggest removing parentheses surrounding lifetimes
Fixes #57386 .
r? @estebank
2019-02-22 14:57:59 +01:00
Patrick McCarter
71cd4c8e4a
ui test for directed quote help suggestion #58436
2019-02-16 20:56:12 -05:00
bors
3315728c06
Auto merge of #57944 - estebank:unclosed-delim-the-quickening, r=oli-obk
...
Deduplicate mismatched delimiter errors
Delay unmatched delimiter errors until after the parser has run to deduplicate them when parsing and attempt recovering intelligently.
Second attempt at #54029 , follow up to #53949 . Fix #31528 .
2019-02-09 20:15:57 +00:00
Igor Sadikov
f753d304c6
Suggest removing parentheses surrounding lifetimes
2019-02-07 16:13:19 -05:00
varkor
455d659e91
Update tests
...
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:17 +01:00
Esteban Küber
336c48cc7b
tweak wording based on in person feedback
2019-02-07 01:42:54 -08:00
Esteban Küber
7451cd8dc0
Deduplicate mismatched delimiter errors
...
Delay unmatched delimiter errors until after the parser has run to
deduplicate them when parsing and attempt recovering intelligently.
2019-02-07 01:41:30 -08:00
Mark Rousskov
e0bc0ba281
Update comment in test which has changed its purpose
2019-01-27 08:59:58 -07:00
David Wood
463e623ca9
Suggestion moving types before associated types.
...
This commit extends existing suggestions to move lifetimes before types
in generic arguments to also suggest moving types behind associated type
bindings.
2019-01-25 11:15:16 +01:00
Mazdak Farrokhzad
da182a0fe7
Rollup merge of #57795 - estebank:did-you-mean, r=zackmdavis
...
Use structured suggestion in stead of notes
2019-01-24 00:19:55 +01:00
Mazdak Farrokhzad
2dd63a2e10
Rollup merge of #57779 - estebank:recover-struct-fields, r=davidtwco
...
Recover from parse errors in literal struct fields and incorrect float literals
Fix #52496 .
2019-01-24 00:19:53 +01:00
Esteban Küber
4745b86202
Accept more invalid code that is close to correct fields
2019-01-21 15:47:23 -08:00
Esteban Küber
45a95b512c
Use structured suggestion in stead of notes
2019-01-20 21:41:25 -08:00
Mazdak Farrokhzad
00c60d115c
Rollup merge of #57784 - JohnTitor:improve-error-message, r=estebank
...
Add span for bad doc comment
Fixes #57382
r? @estebank
2019-01-21 02:21:58 +01:00
Mazdak Farrokhzad
627e001a72
Rollup merge of #57768 - estebank:type-args-sugg, r=zackmdavis
...
Continue parsing after parent type args and suggest using angle brackets
```
error[E0214]: parenthesized parameters may only be used with a trait
--> $DIR/E0214.rs:2:15
|
LL | let v: Vec(&str) = vec!["foo"];
| ^^^^^^
| |
| only traits may use parentheses
| help: use angle brackets instead: `<&str>`
```
r? @zackmdavis
2019-01-21 02:21:55 +01:00
Esteban Küber
defa61f3fb
Tweak field parse error recovery
2019-01-20 15:16:36 -08:00
Yuki Okushi
b97c9641f5
Fix tests
2019-01-21 04:52:30 +09:00
Esteban Küber
b1f169fe7a
Recover from parse errors in struct literal fields
...
Attempt to recover from parse errors while parsing a struct's literal fields
by skipping tokens until a comma or the closing brace is found. This allows
errors in other fields to be reported.
2019-01-20 00:37:06 -08:00
bors
2ab5d8ac44
Auto merge of #57651 - JohnTitor:give-char-type, r=estebank
...
Implement new literal type `Err`
Fixes #57384
I removed `return Ok`, otherwise, two errors occur. Any solutions?
r? @estebank
2019-01-20 08:26:12 +00:00
Yuki Okushi
4005d3a8cb
Remove whitespace
2019-01-20 14:59:10 +09:00
Yuki Okushi
7ce2514419
Fix tests
2019-01-20 14:53:28 +09:00
Esteban Küber
d37a6d83e1
Suggest usage of angle brackets
2019-01-19 19:39:58 -08:00
Yuki Okushi
e9af312932
[WIP] Fix tests
2019-01-20 04:37:58 +09:00
Yuki Okushi
b721c1a885
Fix tests
2019-01-18 05:24:17 +09:00
bors
ceb2512144
Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis
...
Implement basic input validation for built-in attributes
Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax").
For some subset of attributes (found by crater run), errors are lowered to deprecation warnings.
NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-16 15:01:20 +00:00
Yuki Okushi
d33ee3fefa
Fix tests
2019-01-16 09:28:26 +09:00
Vadim Petrochenkov
41c65992c5
Implement basic input validation for built-in attributes
2019-01-13 14:17:19 +03:00
Esteban Küber
28ea03e114
Suggest correct location for lifetime parameters in use
2019-01-12 19:25:03 -08:00
Esteban Küber
db740313e0
Remove unrelated errors from parse stderr tests
2019-01-12 17:12:41 -08:00
Esteban Küber
1550787b13
Add label for invalid literal suffix
2019-01-11 23:37:49 -08:00
Esteban Küber
3ead6de40d
Tweak incorrect discriminator value variant error
2019-01-11 23:12:29 -08:00
Esteban Küber
7feb802d89
Small tweaks to parser errors
2019-01-11 22:04:54 -08:00
Esteban Küber
de3c4be099
Tweak type argument after assoc type error
2019-01-11 21:45:24 -08:00
Esteban Küber
8119017746
Continue evaluating after finding incorrect .. in pattern
2019-01-11 21:33:57 -08:00
Esteban Küber
975f8b5e32
fix test
2019-01-11 21:21:30 -08:00
Esteban Küber
8bede50f23
Continue evaluating after incorrect float literal
2019-01-11 21:19:44 -08:00
Esteban Küber
65a8d7b1d8
fix tests
2019-01-11 21:07:46 -08:00
Esteban Küber
57f17e91d0
Continue evaluating after type argument in where clause
2019-01-11 21:05:48 -08:00
Esteban Küber
5d2f31cddc
Continue evaluating after missing for in impl Trait for Foo
2019-01-11 20:58:51 -08:00
Esteban Küber
d8610b31ec
Continue evaluating after parsing incorrect binary literal
2019-01-11 19:56:41 -08:00
Esteban Küber
fc4b54157f
Continue parsing after lifetime in incorrect location
2019-01-11 19:41:43 -08:00
Vadim Petrochenkov
1f64f60d5c
tests: Do not use -Z parse-only, continue compilation to test recovery
2019-01-06 22:20:46 +03:00
bors
443ae75eaf
Auto merge of #57209 - estebank:suggest-raw-ident, r=petrochenkov
...
Suggest using raw identifiers in 2018 edition when using keywords
2019-01-01 23:30:34 +00:00
Esteban Küber
30961c958d
Do not use unicode character in diagnostic help
2018-12-31 10:00:08 -08:00
Esteban Küber
b416f1398f
Use structured suggestion for braceless unicode escape squence
2018-12-31 09:44:58 -08:00
Esteban Küber
2cd0d14eb1
Address review comments
...
- Suggest raw ident escaping in all editions
- Keep primary label in all cases
2018-12-31 08:24:00 -08:00
Vadim Petrochenkov
bc16edeb28
Fix rebase and more CI failures
2018-12-27 15:51:37 +03:00