about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2020-03-21recover on `for<'a> |...| body` closures.Mazdak Farrokhzad-0/+26
2020-03-20can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.Mazdak Farrokhzad-1/+37
2020-03-18--bless windows testMazdak Farrokhzad-5/+13
2020-03-18tweak outline module parsing spansMazdak Farrokhzad-8/+8
2020-03-18add test for stripped nested outline moduleMazdak Farrokhzad-0/+13
2020-03-18de-fatalize outline module parsingMazdak Farrokhzad-4/+24
2020-03-16Rollup merge of #69520 - kornelski:e69492, r=cramertjDylan DPC-4/+4
Make error message clearer about creating new module This is a partial improvement for #69492
2020-03-12Rollup merge of #69722 - estebank:negative-impl-span-ast, r=CentrilMazdak Farrokhzad-5/+5
Tweak output for invalid negative impl AST errors Use more accurate spans for negative `impl` errors. r? @Centril
2020-03-10parse_if_expr: recover on attributesMazdak Farrokhzad-45/+49
2020-03-10trait-object-lifetime-parens: improve recovery.Mazdak Farrokhzad-27/+29
2020-03-10use check_path moreMazdak Farrokhzad-1/+1
2020-03-10simplify & improve parse_ty_tuple_or_parensMazdak Farrokhzad-43/+89
2020-03-10issue 68890: add more minimal reproMazdak Farrokhzad-0/+17
2020-03-10error_block_no_opening_brace: handle closures betterMazdak Farrokhzad-10/+10
2020-03-10block-no-opening-brace: add another statementMazdak Farrokhzad-44/+45
2020-03-10parser: add note for `'label expr`.Mazdak Farrokhzad-0/+12
2020-03-10parse_labeled_expr: add a suggestion on missing colon.Mazdak Farrokhzad-11/+18
2020-03-10unify/improve/simplify attribute parsingMazdak Farrokhzad-30/+27
2020-03-10parse: recover on `fn foo() = expr;`Mazdak Farrokhzad-0/+140
2020-03-10parse: recover on `&'lt $expr` / `'lt $expr`.Mazdak Farrokhzad-8/+105
2020-03-10more reuse in block parsing & improve diagnostics.Mazdak Farrokhzad-3/+60
2020-03-10use error_block_no_opening_brace moreMazdak Farrokhzad-0/+83
2020-03-09Rollup merge of #69201 - Aaron1011:feature/permit-if-attr, r=CentrilMazdak Farrokhzad-111/+37
Permit attributes on 'if' expressions Previously, attributes on 'if' expressions (e.g. `#[attr] if true {}`) were disallowed during parsing. This made it impossible for macros to perform any custom handling of such attributes (e.g. stripping them away), since a compilation error would be emitted before they ever had a chance to run. This PR permits attributes on 'if' expressions ('if-attrs' from here on). Both built-in attributes (e.g. `#[allow]`, `#[cfg]`) and proc-macro attributes are supported. We still do *not* accept attributes on 'other parts' of an if-else chain. That is, the following code snippet still fails to parse: ```rust if true {} #[attr] else if false {} else #[attr] if false {} #[attr] else {} ``` Closes https://github.com/rust-lang/rust/issues/68618
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-7/+7
fix various typos
2020-03-07Rollup merge of #69708 - estebank:tiny, r=petrochenkovMazdak Farrokhzad-8/+2
On mismatched delimiters, only point at empty blocks that are in the same line We point at empty blocks when we have mismatched braces to detect cases where editors auto insert `}` after writing `{`. Gate this to only the case where the entire span is in the same line so we never point at explicitly empty blocks.
2020-03-07Make error message clearer about creating new moduleKornel-4/+4
2020-03-07Rollup merge of #68985 - daboross:fix-35813, r=CentrilMazdak Farrokhzad-0/+563
Parse & reject postfix operators after casts This adds an explicit error messages for when parsing `x as Type[0]` or similar expressions. Our add an extra parse case for parsing any postfix operator (dot, indexing, method calls, await) that triggers directly after parsing `as` expressions. My friend and I worked on this together, but they're still deciding on a github username and thus I'm submitting this for both of us. It will immediately error out, but will also provide the rest of the parser with a useful parse tree to deal with. There's one decision we made in how this produces the parse tree. In the situation `&x as T[0]`, one could imagine this parsing as either `&((x as T)[0])` or `((&x) as T)[0]`. We chose the latter for ease of implementation, and as it seemed the most intuitive. Feedback welcome! This is our first change to the parser section, and it might be completely horrible. Fixes #35813.
2020-03-06Further tweak spans in ast validation errorsEsteban Küber-5/+5
2020-03-06bless testsMatthias Krüger-7/+7
2020-03-04Update stderrAaron Hill-59/+35
2020-03-04Move if-attr tests to their own directoryAaron Hill-162/+0
2020-03-04Add run-pass test suggested by @joshtriplettAaron Hill-0/+15
2020-03-04Remove recovery testAaron Hill-30/+0
2020-03-04Test trying to cfg-remove an `if` expressionAaron Hill-0/+13
2020-03-04Test that stmt_expr_attrs properly gates if-attrsAaron Hill-0/+18
2020-03-04Test #[allow(unused)] on `if` expressionAaron Hill-0/+12
2020-03-04Permit attributes on 'if' expressionsAaron Hill-25/+109
Previously, attributes on 'if' expressions (e.g. #[attr] if true {}) were disallowed during parsing. This made it impossible for macros to perform any custom handling of such attributes (e.g. stripping them away), since a compilation error would be emitted before they ever had a chance to run. This PR permits attributes on 'if' expressions ('if-attrs' from here on). Both built-in attributes (e.g. `#[allow]`, `#[cfg]`) are supported. We still do *not* accept attributes on 'other parts' of an if-else chain. That is, the following code snippet still fails to parse: ```rust if true {} #[attr] else if false {} else #[attr] if false {} #[attr] else {} ```
2020-03-04On mismatched delimiters, only point at empty blocks that are in the same lineEsteban Küber-8/+2
2020-03-01encode `;` stmt w/o expr as `StmtKind::Empty`Mazdak Farrokhzad-17/+7
2020-02-28Update UI testsGuillaume Gomez-3/+6
2020-02-27Auto merge of #68434 - varkor:astconv-mismatch-error, r=nikomatsakisbors-8/+14
Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues This changes some diagnostics, but I think they're around as helpful as the previous ones, and occur infrequently regardless. Fixes https://github.com/rust-lang/rust/issues/68257. Fixes https://github.com/rust-lang/rust/issues/68398. r? @eddyb
2020-02-24parse: test bad variants wrt. issue 48137.Mazdak Farrokhzad-0/+97
2020-02-24parse: tweak diagnostic wordingsMazdak Farrokhzad-96/+96
2020-02-24parse/ast: move `Defaultness` into variants.Mazdak Farrokhzad-182/+448
2020-02-24parse: `NtItem` -> `parse_item_common`.Mazdak Farrokhzad-0/+34
2020-02-24parser: tweak item kind wordingMazdak Farrokhzad-80/+80
2020-02-24parser: tweak unmatched wordingMazdak Farrokhzad-24/+36
2020-02-24parse: harden `default` test.Mazdak Farrokhzad-56/+96
2020-02-24parse: use `parse_item_common` in `parse_assoc_item_`.Mazdak Farrokhzad-86/+479
2020-02-24parse: use `parse_item_common` in `parse_foreign_item`.Mazdak Farrokhzad-31/+327