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
Vadim Petrochenkov
fff01ccfa8
Do not abort compilation if expansion produces errors
...
Fix a number of uncovered deficiencies in diagnostics
2018-12-27 15:51:36 +03:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Esteban Küber
25b3c82508
Do not point at delim spans for complete correct blocks
2018-12-17 10:22:49 -08:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
bors
4bb5d35659
Auto merge of #56392 - petrochenkov:regensym, r=oli-obk
...
Delay gensym creation for "underscore items" (`use foo as _`/`const _`) until name resolution
So they cannot be cloned by macros. See https://github.com/rust-lang/rust/pull/56303 for the discussion.
Mostly fix cross-crate use of underscore items by inverting the "gensyms are lost in metadata" bug as described in https://github.com/rust-lang/rust/pull/56303#issuecomment-442464695 .
Fix unused import warnings for single-segment imports (first commit) and `use crate_name as _` imports (as specified in https://github.com/rust-lang/rust/pull/56303#issuecomment-442274118 ).
Prohibit accidentally implemented `static _: TYPE = EXPR;` (cc https://github.com/rust-lang/rust/pull/55983 ).
Add more tests for `use foo as _` imports.
2018-12-06 15:08:11 +00:00
Oliver Scherer
61efc3b71b
Update tests
2018-12-04 10:06:05 +01:00
Vadim Petrochenkov
2d4b633be3
Delay gensym creation for "underscore items" until name resolution
...
Prohibit `static _`
Fis unused import warnings for `use foo as _`
Add more tests for `use foo as _`
2018-12-02 15:42:30 +03:00
Guillaume Gomez
796892e0ef
Rollup merge of #56220 - estebank:suggest-lifetime-move, r=nikomatsakis
...
Suggest appropriate place for lifetime when declared after type arguments
2018-11-29 13:10:39 +01:00
Esteban Küber
79ee8f329d
Suggest appropriate place for lifetime when declared after type arguments
2018-11-25 12:41:38 -08:00
Esteban Küber
e5cd1edfa1
Reword incorrect macro invocation primary label
2018-11-23 15:37:31 -08:00
bors
af791bb8f4
Auto merge of #55451 - estebank:arg-doc, r=pnkfelix
...
Custom diagnostic when trying to doc comment argument
When writing
```
pub fn f(
/// Comment
id: u8,
) {}
```
Produce a targeted diagnostic
```
error: documentation comments cannot be applied to method arguments
--> $DIR/fn-arg-doc-comment.rs:2:5
|
LL | /// Comment
| ^^^^^^^^^^^ doc comments are not allowed here
```
Fix #54801 .
2018-11-05 16:36:18 +00:00
Esteban Küber
3e22e0c3bc
Use token description in "expected/found" parse messages
2018-10-28 16:05:50 -07:00
Esteban Küber
adb96ec64b
Provide specific label for patern parsing error
2018-10-28 14:38:00 -07:00
Esteban Küber
d491734b15
Point at match when a parse failure ocurrs inside of it
2018-10-28 11:41:23 -07:00
Esteban Küber
ea57134607
Produce targeted diagnostic when using doc comments on fn args
...
Before parsing argument names and types, try to consume an incorrectly
included doc comment or attribute in order to recover and continue
parsing the rest of the fn definition.
2018-10-28 11:38:50 -07:00
kennytm
eb74711b54
Rollup merge of #55298 - estebank:macro-def, r=pnkfelix
...
Point at macro definition when no rules expect token
Fix #35150 .
2018-10-26 23:06:30 +08:00
Esteban Küber
1ab45ec7e3
Point to macro def span instead of whole body
2018-10-24 11:34:23 -07:00
Esteban Küber
8227a938a4
Point at macro definition when no rules expect token
2018-10-23 21:44:46 -07:00
Esteban Küber
ad144ac3c1
Modify invalid macro in expression context diagnostic
2018-10-23 10:07:34 -07:00
Vadim Petrochenkov
21d67c45a3
Fix a few tests with target-specific output
...
Enable one fully ignored test
2018-10-21 14:06:29 +03:00
Vadim Petrochenkov
7977250fb4
Make sure all ui/parse tests have -Z parse-only
...
Except those testing parsing during macro expansion
2018-10-21 14:06:29 +03:00
Vadim Petrochenkov
64c0efab85
Make some ui/parser tests compile-pass
2018-10-21 14:06:28 +03:00
Vadim Petrochenkov
51f3b6241d
Move more parsing tests to ui/parser
2018-10-21 14:06:28 +03:00
Vadim Petrochenkov
73e1f8970f
Move parse-fail tests to UI
2018-10-21 14:06:28 +03:00
Andy Russell
f5db411410
add suggestion for inverted function parameters
...
Fixes #54065 .
2018-10-05 10:33:19 -04:00