summary refs log tree commit diff
path: root/src/test/parse-fail
AgeCommit message (Collapse)AuthorLines
2018-04-17Rollup merge of #49699 - zesterer:master, r=joshtriplettGuillaume Gomez-19/+0
Removed 'proc' from the reserved keywords list Remove 'proc' from the reserved keywords list. 'proc' is a very useful identifier name for a lot of things. It's especially useful when dealing with processes, operating system internals, and kernel development.
2018-04-11Removed proc testJoshua Barretto-19/+0
2018-04-05Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkovAlex Crichton-3/+3
Expand macros in `extern {}` blocks This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature. A tracking issue is now open at #49476 closes #48747
2018-04-03expand macro invocations in `extern {}` blocksAustin Bonander-3/+3
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-2/+1
Closes #22181, #27779
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-1/+1
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-5/+4
2018-03-15Stabilize `inclusive_range_syntax` language feature.kennytm-78/+0
Stabilize the syntax `a..=b` and `..=b`.
2018-03-15Stabilize `inclusive_range` library feature.kennytm-3/+3
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
2018-03-11in which some labels and notes are upgraded to structured suggestionsZack M. Davis-49/+0
(Meanwhile, a couple of parse-fail tests are moved to UI tests so that the reader can see the new output, and an existing UI test is given a more evocative name.)
2018-03-09Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkovbors-7/+6
Warn about ignored generic bounds in `for` This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here. Questions to the reviewer: * Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!). * Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`). * For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right? Cc @eddyb
2018-03-06make bounds on higher-kinded lifetimes a hard error in ast_validationRalf Jung-7/+6
Also move the check for not having type parameters into ast_validation. I was not sure what to do with compile-fail/issue-23046.rs: The issue looks like maybe the bounds actually played a role in triggering the ICE, but that seems unlikely given that the compiler seems to entirely ignore them. However, I couldn't find a testcase without the bounds, so I figured the best I could do is to just remove the bounds and make sure at least that keeps working.
2018-03-01Support parentheses in patterns under feature gateVadim Petrochenkov-18/+1
Improve recovery for trailing comma after `..`
2018-02-11Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakisbors-1/+1
Implement `?` macro repetition See rust-lang/rfcs#2298 (with disposition merge)
2018-02-01Improve char escaping in lexer messagesRyan Cumming-1/+14
Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
2018-01-30Fix a couple of testsMark Mansi-1/+1
2018-01-27Make `+` in `impl/dyn Trait` non-associativeVadim Petrochenkov-47/+0
2018-01-27Add testsVadim Petrochenkov-2/+49
2018-01-14syntax: Disambiguate generics and qualified pathsVadim Petrochenkov-1/+19
2018-01-14syntax: Rewrite parsing of implsVadim Petrochenkov-38/+1
Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits Change wording in more diagnostics to use "auto traits" Some minor code cleanups in the parser
2018-01-13Auto merge of #47242 - estebank:issue-15980, r=petrochenkovbors-0/+1
`struct` pattern parsing and diagnostic tweaks - Recover from struct parse error on match and point out missing match body. - Point at struct when finding non-identifier while parsing its fields. - Add label to "expected identifier, found {}" error. Fix #15980.
2018-01-07`struct` pattern parsing and diagnostic tweaksEsteban Küber-0/+1
- Recover from struct parse error on match and point out missing match body. - Point at struct when finding non-identifier while parsing its fields. - Add label to "expected identifier, found {}" error.
2018-01-07Auto merge of #47156 - petrochenkov:extpath, r=nikomatsakisbors-17/+0
Support `extern` in paths Implement the primary alternative to https://github.com/rust-lang/rust/pull/46613 + https://github.com/rust-lang/rust/pull/45771, achieving the same effect without requiring changes to other imports. Both need to be experimentally evaluated before making further progress. The PR also adds docs for all these related features into the unstable book. cc https://github.com/rust-lang/rust/issues/44660 r? @nikomatsakis
2018-01-03Support `extern` in pathsVadim Petrochenkov-17/+0
2018-01-02Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.Ed Schouten-3/+4
It looks like many of these tests are already disabled on emscripten, which also doesn't seem to support environment variables and subprocess spawning. Just add a similar tag for CloudABI. While there, sort some of the lists of operating systems alphabetically.
2017-12-30Remove excessive trailing newlines.kennytm-2/+0
2017-12-30Add trailing newlines to files which have no trailing newlines.kennytm-1/+1
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-4/+6
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-20Fix whitespacing issues in pretty-printing of boundsVadim Petrochenkov-5/+5
2017-12-14When attempting to write str with single quote suggest double quotesEsteban Küber-2/+2
2017-12-07Auto merge of #46497 - AgustinCB:issue-46311, r=petrochenkovbors-52/+0
Modify message for keyword as identifier name This is a temporary solution to #46311. The message is generic enough to cover both cases and is probably a fine enough solution to the specific problem described in the task. However, the underlying reason for this to be wrong is that `next_token_inner` returns `Lifetime` even if the token is a label. That's not simple, as the syntax for both can be quite similar and it may need to take a look to the next token to make a decision. I'm not sure I have enough knowledge about the project to be able to solve that (yet!), so I thought I'll fix the immediate problem first.
2017-12-07Auto merge of #46187 - notriddle:patch-1, r=QuietMisdreavusbors-2/+2
Rename C-like enum to Field-less enum There is no need to reference the C programming language to explain this concept.
2017-12-06and refactor to just move the checkingAgustin Chiappe Berrini-52/+0
2017-11-24Consume trailing doc comments to avoid parse errorsEsteban Küber-2/+10
2017-11-24Revert to correct recovery behaviorEsteban Küber-9/+9
2017-11-24Suggest macro call when not sure that it is fn definitionEsteban Küber-13/+15
2017-11-22Update issue-17383.rsMichael Howell-1/+1
2017-11-22Rename C-like enum to Field-less enumMichael Howell-1/+1
There is no need to reference the C programming language to explain this concept.
2017-11-21Support `::crate` in pathsVadim Petrochenkov-17/+0
2017-11-10Auto merge of #45773 - Badel2:dotdoteq, r=petrochenkovbors-0/+38
Add error for `...` in expressions Follow-up to https://github.com/rust-lang/rust/pull/44709 Tracking issue: https://github.com/rust-lang/rust/issues/28237 * Using `...` in expressions was a warning, now it's an error * The error message suggests using `..` or `..=` instead, and explains the difference * Updated remaining occurrences of `...` to `..=` r? petrochenkov
2017-11-06Test error for `...` in expressionsBadel2-0/+38
2017-11-03Detect `=` -> `:` typo in let bindingsEsteban Küber-1/+0
When encountering a let binding type error, attempt to parse as initializer instead. If successful, it is likely just a typo: ```rust fn main() { let x: Vec::with_capacity(10); } ``` ``` error: expected type, found `10` --> file.rs:3:31 | 3 | let x: Vec::with_capacity(10, 20); | -- ^^ | || | |help: did you mean assign here?: `=` | while parsing the type for `x` ```
2017-10-22`crate` shorthand visibility modifierZack M. Davis-3/+3
With regrets, this breaks rustfmt and rls. This is in the matter of #45388.
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-0/+2
2017-10-10output compiler message updatedJean Lourenço-1/+2
output message is shown in another 'help:' block line with +100 columns formatted test adjusted
2017-09-22Add support for `..=` syntaxAlex Burka-12/+13
Add ..= to the parser Add ..= to libproc_macro Add ..= to ICH Highlight ..= in rustdoc Update impl Debug for RangeInclusive to ..= Replace `...` to `..=` in range docs Make the dotdoteq warning point to the ... Add warning for ... in expressions Updated more tests to the ..= syntax Updated even more tests to the ..= syntax Updated the inclusive_range entry in unstable book
2017-09-12Auto merge of #43716 - MaloJaffre:_-in-literals, r=petrochenkovbors-9/+22
Accept underscores in unicode escapes Fixes #43692. I don't know if this need an RFC, but at least the impl is here!
2017-08-31Auto merge of #43425 - matklad:lambda-restrictions, r=eddybbors-0/+29
Lambda expressions honor no struct literal restriction This is a fix for #43412 if we decide that it is indeed a bug :) closes #43412
2017-08-17Accept underscores in unicode escapesMalo Jaffré-9/+22
Fixes #43692.
2017-08-11syntax: Relax path grammarVadim Petrochenkov-30/+2