about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2019-05-11Move literal parsing code into a separate fileVadim Petrochenkov-4/+4
Remove some dead code
2019-05-09Rollup merge of #60188 - estebank:recover-block, r=varkorMazdak Farrokhzad-8/+186
Identify when a stmt could have been parsed as an expr There are some expressions that can be parsed as a statement without a trailing semicolon depending on the context, which can lead to confusing errors due to the same looking code being accepted in some places and not others. Identify these cases and suggest enclosing in parenthesis making the parse non-ambiguous without changing the accepted grammar. Fix #54186, cc #54482, fix #59975, fix #47287.
2019-05-02fix typoEsteban Küber-12/+12
2019-05-02introduce unescape moduleAleksey Kladov-77/+120
Currently, we deal with escape sequences twice: once when we lex a string, and a second time when we unescape literals. This PR aims to remove this duplication, by introducing a new `unescape` mode as a single source of truth for character escaping rules
2019-04-30Reword ambigous parse error to fit with the current errorEsteban Küber-8/+8
2019-04-29Add test case for #47287Esteban Küber-1/+25
2019-04-29Identify when a stmt could have been parsed as an exprEsteban Küber-3/+157
There are some expressions that can be parsed as a statement without a trailing semicolon depending on the context, which can lead to confusing errors due to the same looking code being accepted in some places and not others. Identify these cases and suggest enclosing in parenthesis making the parse non-ambiguous without changing the accepted grammar.
2019-04-25Rollup merge of #60160 - xldenis:fix-overlapping-zero-width-annotation, ↵Mazdak Farrokhzad-3/+2
r=estebank Fix #58270, fix off-by-one error in error diagnostics. This fixes #58270 by checking if two diagnostics overlap completely when we're calculating the line offset for each message.
2019-04-23Remove unnecessary tidy ignore directivesvarkor-8/+5
2019-04-22Fix #58270, fix off-by-one error in error diagnostics.Xavier Denis-3/+2
2019-04-19Some cleanup to `maybe_parse_struct_expr`Vadim Petrochenkov-0/+1
2019-04-19Emit specific error for struct literal in conditionsEsteban Küber-156/+92
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-8/+6
2019-04-11review commentsEsteban Küber-2/+2
2019-04-10Recover from missing semicolon based on the found tokenEsteban Küber-0/+52
When encountering one of a few keywords when a semicolon was expected, suggest the semicolon and recover: ``` error: expected one of `.`, `;`, `?`, or an operator, found `let` --> $DIR/recover-missing-semi.rs:4:5 | LL | let _: usize = () | - help: missing semicolon here LL | LL | let _ = 3; | ^^^ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () | ^^ expected usize, found () | = note: expected type `usize` found type `()` ```
2019-04-01Rollup merge of #59041 - saleemjaffer:trait_doc_comment_better_error_msg, ↵Mazdak Farrokhzad-0/+17
r=pnkfelix fixes rust-lang#56766 fixes #56766
2019-03-31Rollup merge of #59572 - davidtwco:issue-59508, r=varkorMazdak Farrokhzad-5/+5
Include bounds in generic re-ordering diagnostic Fixes #59508. r? @estebank cc @varkor
2019-03-31Only mention const generics if enabled.David Wood-5/+5
This commit updates the generic parameter re-ordering diagnostic to only mention const generics if the feature is enabled.
2019-03-30Rollup merge of #59453 - estebank:recover-tuple-parse, r=petrochenkovMazdak Farrokhzad-4/+124
Recover from parse error in tuple syntax
2019-03-29revert change to test file as per review requestEsteban Küber-2/+1
2019-03-29Rollup merge of #59467 - hgallagher1993:local_branch, r=estebankMazdak Farrokhzad-2/+4
Better diagnostic for binary operation on BoxedValues Fixes #59458
2019-03-28fix text after rebaseEsteban Küber-0/+8
2019-03-28Rollup merge of #59408 - euclio:compiletest-normalization, r=oli-obkMazdak Farrokhzad-71/+71
compiletest: make path normalization smarter Fixes #59109.
2019-03-28Recover from parse error in tuple syntaxEsteban Küber-5/+118
2019-03-28Rollup merge of #59198 - estebank:recovered-pattern, r=zackmdavisMazdak Farrokhzad-18/+2
Do not complain about unmentioned fields in recovered patterns When the parser has to recover from malformed code in a pattern, do not complain about missing fields. Fix #59145.
2019-03-27Rollup merge of #59421 - estebank:tuple-index-suffix, r=petrochenkovJosh Stone-24/+68
Reject integer suffix when tuple indexing Fix #59418. r? @varkor
2019-03-27Better diagnostic for binary operation on BoxedValueshgallagher1993-2/+4
2019-03-26Add specific message for tuple struct invoked with suffixed numeric field nameEsteban Küber-1/+19
2019-03-26Reword invalid suffixe errorsEsteban Küber-30/+30
2019-03-26Use `expect_no_suffix` for errorEsteban Küber-7/+6
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-0/+32
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-25review commentsEsteban Küber-3/+13
2019-03-25Reject integer suffix when tuple indexingEsteban Küber-0/+17
2019-03-25compiletest: make path normalization smarterAndy Russell-71/+71
2019-03-23Tweak unsupported negative trait bounds messageEsteban Küber-29/+38
2019-03-22Reword type ascription note to reduce verbosityEsteban Küber-24/+4
2019-03-22Review commentEsteban Küber-4/+4
2019-03-22Expand suggestions for type ascription parse errorsEsteban Küber-0/+52
2019-03-22Rollup merge of #59322 - estebank:diag-tweak, r=davidtwcoMazdak Farrokhzad-49/+23
Tweak incorrect escaped char diagnostic
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-0/+21
Do not complain about non-existing fields after parse recovery When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it. Fix #57361.
2019-03-20Tweak incorrect escaped char diagnosticEsteban Küber-49/+23
2019-03-17Do not complain about non-existing fields after parse recoveryEsteban Küber-0/+21
When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it.
2019-03-16Recover from incorrect `pub` kw in "reasonable" placesEsteban Küber-15/+9
2019-03-16Recover from missing comma between enum variantsEsteban Küber-8/+22
2019-03-16syntax: Introduce `Ident::can_be_raw`Vadim Petrochenkov-12/+14
2019-03-14Do not complain about unmentioned fields in recovered patternsEsteban Küber-18/+2
When the parser has to recover from malformed code in a pattern, do not complain about missing fields.
2019-03-13add suggestions to invalid macro item errorAndy Russell-2/+50
2019-03-13tidy testSaleem Jaffer-1/+1
2019-03-13adding testSaleem Jaffer-0/+17
2019-03-13Rollup merge of #58876 - estebank:numeric-lifetime, r=petrochenkovMazdak Farrokhzad-0/+32
Parse lifetimes that start with a number and give specific error Fix #58786.