about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2020-02-01Improve wording and docs for qualified path recoveryRob Pilling-3/+3
2020-02-02Use `next_point` to avoid ICEYuki Okushi-0/+0
2020-01-31Auto merge of #68633 - JohnTitor:avoid-ice-in-diagnostics, r=estebankbors-5/+4
Avoid ICE in macro's diagnostics Fixes #68629 r? @estebank
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-1/+1
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-30Suggest path separator for single-colon typosRob Pilling-0/+46
This commit adds guidance for when a user means to type a path, but ends up typing a single colon, such as `<<Impl as T>:Ty>`. This change seemed pertinent as the current error message is particularly misleading, emitting `error: unmatched angle bracket`, despite the angle bracket being matched later on, leaving the user to track down the typo'd colon.
2020-01-30suggest adding space in accidental doc commentsAndy Russell-0/+70
2020-01-29Avoid ICE in macro's diagnosticsYuki Okushi-5/+4
2020-01-24Normalise notes with the/isvarkor-1/+1
2020-01-19When encountering an undefined named lifetime, point to where it can beEsteban Küber-0/+3
This doesn't mention that using an existing lifetime is possible, but that would hopefully be clear as always being an option. The intention of this is to teach newcomers what the lifetime syntax is.
2020-01-18slice_patterns: organize some testsMazdak Farrokhzad-35/+0
2020-01-18slice_patterns: remove gates in testsMazdak Farrokhzad-37/+6
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-1/+10
2020-01-12Rollup merge of #68108 - varkor:chained-comparison-suggestions, r=CentrilMazdak Farrokhzad-11/+220
Add suggestions when encountering chained comparisons Ideally, we'd also prevent the type error, which is just extra noise, but that will require moving the error from the parser, and I think the suggestion makes things clear enough for now. Fixes https://github.com/rust-lang/rust/issues/65659.
2020-01-11Ban `...X` pats, harden tests, and improve diagnostics.Mazdak Farrokhzad-68/+68
Also fix a bug with the span passed in `mk_range`.
2020-01-11Add suggestions when encountering chained comparisonsvarkor-11/+220
2020-01-10Introduce `#![feature(half_open_range_patterns)]`.Mazdak Farrokhzad-430/+222
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-09Add tests for RFC 2632Dylan MacKenzie-1/+12
2020-01-09Update testsVadim Petrochenkov-6/+35
2020-01-08Remove `-Z continue-parse-after-error`Vadim Petrochenkov-75/+64
2020-01-03tweak wording of mismatched delimiter errorsAndy Russell-97/+97
2019-12-31Rollup merge of #67744 - Centril:reduce-diversity, r=petrochenkovMazdak Farrokhzad-3/+14
parser: reduce diversity in error handling mechanisms Instead of having e.g. `span_err`, `fatal`, etc., we prefer to move towards uniformly using `struct_span_err` thus making it harder to emit fatal and/or unstructured diagnostics. This PR also de-fatalizes some diagnostics. r? @estebank
2019-12-31parser::pat: remove .fatal callsMazdak Farrokhzad-2/+6
2019-12-31de-fatalize some errorsMazdak Farrokhzad-1/+8
2019-12-30refactor and fix this-expression-has-type noteMazdak Farrokhzad-6/+9
2019-12-30MatchExpressionArmPattern: Use more generic wording.Mazdak Farrokhzad-1/+1
The existing wording was inappropriate for e.g. `if let Ok(_) = expr { .. }`. The diagnostic would leak the fact that we desugar to a `match`.
2019-12-30note other end-point when typeck range patsMazdak Farrokhzad-19/+31
2019-12-23extract parse_dot_suffix_exprMazdak Farrokhzad-3/+3
2019-12-23extract error_unexpected_after_dot and de-fatalizeMazdak Farrokhzad-22/+33
2019-12-23more recovery in if-parsingMazdak Farrokhzad-5/+5
2019-12-22Rollup merge of #67148 - Centril:ty-polish, r=estebankMazdak Farrokhzad-30/+52
Refactor type & bounds parsing thoroughly PR is based on https://github.com/rust-lang/rust/pull/67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`. Also fixes #67146. r? @estebank
2019-12-21span_suggestion_hidden -> tool_only_span_suggestionMazdak Farrokhzad-16/+0
2019-12-21parse_generic_bounds: account for negative lifetime boundsMazdak Farrokhzad-25/+63
2019-12-21Rollup merge of #67160 - matthewjasper:gat-generics, r=nikomatsakisMazdak Farrokhzad-1/+8
Make GATs less ICE-prone. After this PR simple lifetime-generic associated types can now be used in a compiling program. There are two big limitations: * #30472 has not been addressed in any way (see src/test/ui/generic-associated-types/iterable.rs) * Using type- and const-generic associated types errors because bound types and constants aren't handled by trait solving. * The errors are technically non-fatal, but they happen in a [part of the compiler](https://github.com/rust-lang/rust/blob/4abb0ad2731e9ac6fd5d64d4cf15b7c82e4b5a81/src/librustc_typeck/lib.rs#L298) that fairly aggressively stops compiling on errors. closes #47206 closes #49362 closes #62521 closes #63300 closes #64755 closes #67089
2019-12-21Update tests for GATsMatthew Jasper-1/+8
* Make some run-pass or check-pass * Use `#![allow(incomplete_features)]` * Update FIXMEs now that some of the issues have been addressed * Add regression tests
2019-12-20tweak var/auto/mut recoveryMazdak Farrokhzad-24/+32
2019-12-20ast_stmt_expr_attr -> pretty & ui testsMazdak Farrokhzad-0/+517
2019-12-20recover `#[attr] if expr {}`Mazdak Farrokhzad-0/+44
2019-12-20recover on 'mut', 'var', 'auto'Mazdak Farrokhzad-0/+80
2019-12-20recover on 'do catch { .. }'Mazdak Farrokhzad-5/+19
2019-12-20add recovery to parse_labeled_exprMazdak Farrokhzad-0/+22
2019-12-20Add a UI test for correct parsingA C-0/+32
2019-12-20Rollup merge of #67131 - Centril:item-merge, r=petrochenkovMazdak Farrokhzad-35/+594
Merge `TraitItem` & `ImplItem into `AssocItem` In this PR we: - Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. - This is done by using the cover grammar of both forms. - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`): - `default`ness on `trait` items, - `impl` items without a body / definition (`const`, `type`, and `fn`), - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`. - The syntactic restrictions are replaced by semantic ones in `ast_validation`. - Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`: - `fn`s in all contexts now syntactically allow `...`, - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`), - and `...` can be the sole parameter (`fn foo(...) {}`. r? @petrochenkov
2019-12-13parser: recover on `&'lifetime mut $pat`.Mazdak Farrokhzad-2/+38
2019-12-12De-fatalize `...` parsing.Mazdak Farrokhzad-0/+33
Also fix error the code description.
2019-12-12More c-variadic errors as semantic restrictions.Mazdak Farrokhzad-36/+282
2019-12-12Move `allow_c_varadic` logic to `ast_validation`.Mazdak Farrokhzad-28/+89
2019-12-12Unify assoc item visitors more.Mazdak Farrokhzad-6/+8
2019-12-12Unify associated item parsing.Mazdak Farrokhzad-1/+1
An exception is `fn` params.
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-0/+106
2019-12-12Use `Option` in `ImplItemKind::Method`.Mazdak Farrokhzad-1/+28