about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2019-08-01Fix ICE in #63135Michael Lamparski-0/+47
2019-08-01Rollup merge of #63122 - Centril:fix-63115, r=petrochenkovPietro Albini-1/+126
Account for `maybe_whole_expr` in range patterns Fixes https://github.com/rust-lang/rust/issues/63115 (fallout from https://github.com/rust-lang/rust/pull/62550). r? @petrochenkov
2019-07-30Rollup merge of #62928 - Centril:recover-parens-around-for-head, r=estebankMazdak Farrokhzad-0/+42
Syntax: Recover on `for ( $pat in $expr ) $block` Fixes #62724 by adding some recovery: ``` error: unexpected closing `)` --> $DIR/recover-for-loop-parens-around-head.rs:10:23 | LL | for ( elem in vec ) { | --------------^ | | | opening `(` | help: remove parenthesis in `for` loop: `elem in vec` ``` The last 2 commits are drive-by cleanups. r? @estebank
2019-07-30Account for maybe_whole_expr in range patterns.Mazdak Farrokhzad-1/+126
2019-07-28Rollup merge of #62995 - estebank:issue-62973, r=varkorMazdak Farrokhzad-0/+69
Avoid ICE when suggestion span is at Eof Fix #62973.
2019-07-28Recover 'for ( $pat in $expr ) $block'.Mazdak Farrokhzad-0/+42
2019-07-28Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkovMazdak Farrokhzad-58/+833
Implement RFC 2707 + Parser recovery for range patterns Implement https://github.com/rust-lang/rfcs/pull/2707. - Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result. - Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later). - Refactor `parser.rs` wrt. parsing sequences and lists of things in the process. - Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`. This should make it easy to actually support these patterns semantically later if we so desire. cc https://github.com/rust-lang/rust/issues/62254 r? @petrochenkov
2019-07-28And --bless tests accordingly for those exceptions.Mazdak Farrokhzad-476/+167
2019-07-28Address comments re. off-topic errors.Mazdak Farrokhzad-44/+48
2019-07-28--bless tests after rebase.Mazdak Farrokhzad-5/+5
2019-07-28Win some lose some; Unfortunately we lost recovery in one case.Mazdak Farrokhzad-20/+4
2019-07-28(pat, ..,) is now syntactically legal.Mazdak Farrokhzad-9/+2
2019-07-28Account for better recovery in two cases.Mazdak Farrokhzad-2/+43
2019-07-28--bless tests due to new subslice syntax.Mazdak Farrokhzad-10/+49
2019-07-28Use new 'p @ ..' syntax in tests.Mazdak Farrokhzad-1/+1
2019-07-28Test parsing and recovery of all sorts of range patterns.Mazdak Farrokhzad-0/+949
2019-07-28And also --bless those recovery tests.Mazdak Farrokhzad-7/+71
2019-07-28Update tests wrt. recovery of range patterns.Mazdak Farrokhzad-2/+12
2019-07-27Fix ui/parser/attr testEvgenii P-2/+2
2019-07-27Fix failing UI testsEvgenii P-3/+8
2019-07-27Make more informative error on outer attr after innerEvgenii P-2/+5
2019-07-26ignore-tidy-trailing-newlinesEsteban Küber-1/+1
2019-07-26Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkovMazdak Farrokhzad-0/+26
Allow lexer to recover from some homoglyphs
2019-07-25Avoid ICE when suggestion span is at EofEsteban Küber-0/+69
2019-07-25Rollup merge of #62887 - estebank:issue-62881, r=petrochenkovMazdak Farrokhzad-0/+95
Make the parser TokenStream more resilient after mismatched delimiter recovery Fix #62881, fix #62895.
2019-07-24Allow lexer to recover from some homoglyphsEsteban Küber-0/+26
2019-07-24Rollup merge of #62917 - estebank:trailing-slash, r=matkladMazdak Farrokhzad-0/+19
Always emit trailing slash error Fix #62913. r? @petrochenkov
2019-07-23Always emit trailing slash errorEsteban Küber-0/+19
2019-07-23review commentsEsteban Küber-0/+95
2019-07-23Rollup merge of #62791 - estebank:type-ascription, r=petrochenkovMark Rousskov-13/+10
Handle more cases of typos misinterpreted as type ascription Fix #60933, #54516. CC #47666, #34255, #48016.
2019-07-22fix lexing of comments with many \rAleksey Kladov-0/+30
closes #62863
2019-07-20Introduce rustc_lexerAleksey Kladov-7/+7
The idea here is to make a reusable library out of the existing rust-lexer, by separating out pure lexing and rustc-specific concerns, like spans, error reporting an interning. So, rustc_lexer operates directly on `&str`, produces simple tokens which are a pair of type-tag and a bit of original text, and does not report errors, instead storing them as flags on the token.
2019-07-19Handle more cases of typos misinterpreted as type ascriptionEsteban Küber-13/+10
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-16Rollup merge of #62703 - ↵Mark Rousskov-1/+1
fakenine:normalize_use_of_backticks_compiler_messages_p6, r=eddyb normalize use of backticks in compiler messages for libsyntax/parse https://github.com/rust-lang/rust/issues/60532
2019-07-15Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebankMark Rousskov-0/+19
Fix #62660 If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-16normalize use of backticks in compiler messages for libsyntax/parseSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-14Auto merge of #62643 - estebank:parse-recovery-type-errs, r=petrochenkovbors-26/+33
Do not emit type errors after parse error in last statement of block When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-13Don't drop DiagnosticBuilder if parsing failsJonathan Goodman-0/+19
If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-12Do not emit type errors after parse error in last statement of blockEsteban Küber-26/+33
When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-11Handle errors during error recovery gracefullyEsteban Küber-0/+20
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-4/+4
https://github.com/rust-lang/rust/issues/60532
2019-07-04Rollup merge of #62317 - JohnTitor:move-tests-to-build-pass, r=CentrilMazdak Farrokhzad-5/+5
Migrate `compile-pass` annotations to `build-pass` This is a part of #62277. As a first step, the `compile-pass` tests are migrated to `build-pass`. r? @cramertj cc @Centril
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-5/+5
2019-07-01syntax: Unsupport `foo! bar { ... }` macros in the parserVadim Petrochenkov-4/+4
Unreserve `macro_rules` as a macro name
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-13/+21
2019-06-16Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkovbors-11/+122
Stabilize underscore_const_names in 1.37.0 You are now permitted to write: ```rust const _: $type_expression = $term_expression; ``` That is, we change the [grammar of items](https://github.com/rust-lang-nursery/wg-grammar/blob/9d1984d7ae8d6576f943566539a31a5800644c57/grammar/item.lyg#L3-L42), as written in [the *`.lyg`* notation](https://github.com/rust-lang/gll/tree/263bf161dad903e67aa65fc591ced3cab18afa2a#grammar), from: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IDENT ":" ty:Type "=" value:Expr ";" } | ... ; ``` into: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IdentOrUnderscore ":" ty:Type "=" value:Expr ";" } | ... ; IdentOrUnderscore = | Named:IDENT | NoName:"_" ; ``` r? @petrochenkov
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-32/+32
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-10Auto merge of #60793 - Xanewok:raw-string-cleanup, r=petrochenkovbors-7/+16
lexer: Disallow bare CR in raw byte strings Handles bare CR ~but doesn't translate `\r\n` to `\n` yet in raw strings yet~ and translates CRLF to LF in raw strings. As a side-note I think it'd be good to change the `unescape_` to return plain iterators to reduce some boilerplate (e.g. `has_error` could benefit from collecting `Result<T>` and aborting early on errors) but will do that separately, unless I missed something here that prevents it. @matklad @petrochenkov thoughts?
2019-06-10Don't suggest using \r in raw stringsIgor Matuszewski-4/+4