about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2020-02-17parse: recover `mut (x @ y)` as `(mut x @ mut y)`.Mazdak Farrokhzad-11/+21
2020-02-17Auto merge of #69129 - Centril:macro-legacy-errors, r=petrochenkovbors-0/+21
Transition macro_legacy_warnings into a hard error Fixes https://github.com/rust-lang/rust/issues/67098. r? @petrochenkov
2020-02-15Fix test stderr after rebasing on master.David Ross-2/+2
2020-02-15Remove trailing whitespaceDavid Ross-3/+3
2020-02-15Add more error cases to issue 35813 testsDavid Ross-58/+225
2020-02-15Parse & reject postfix operators after castsDavid Ross-0/+137
This adds parsing for expressions like 'x as Ty[0]' which will immediately error out, but still give the rest of the parser a valid parse tree to continue.
2020-02-15reject assoc statics & extern consts during parsingMazdak Farrokhzad-67/+154
2020-02-15fuse extern & associated item parsing up to defaultnessMazdak Farrokhzad-21/+25
2020-02-15parse extern constsMazdak Farrokhzad-14/+46
2020-02-15parse associated statics.Mazdak Farrokhzad-15/+197
2020-02-15ast/parser: fuse `static` & `const` grammars in all contexts.Mazdak Farrokhzad-46/+122
2020-02-15ast: make `= <expr>;` optional in free statics/consts.Mazdak Farrokhzad-0/+104
2020-02-16Add test for issue-62894Yuki Okushi-0/+54
2020-02-15ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`.Mazdak Farrokhzad-4/+99
2020-02-14Suggest a comma if a struct initializer field fails to parseAaron Hill-2/+3
Currently, we emit a "try adding a comma" suggestion if a comma is missing in a struct definition. However, we emit no such suggestion if a comma is missing in a struct initializer. This commit adds a "try adding a comma" suggestion when we don't find a comma during the parsing of a struct initializer field. The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't great, but I don't see a good way of avoiding it.
2020-02-13parser: misc small item related improvements & cleanups.Mazdak Farrokhzad-84/+88
2020-02-13parser: unify item list parsing.Mazdak Farrokhzad-14/+25
as a consequence, `trait X { #![attr] }` becomes legal.
2020-02-13macro_legacy_warnings -> errorMazdak Farrokhzad-0/+21
2020-02-13parser: add test for 'extern crate async'Mazdak Farrokhzad-0/+12
2020-02-13ast_validation: tweak diagnostic outputMazdak Farrokhzad-20/+20
2020-02-13parser: fuse free `fn` parsing together.Mazdak Farrokhzad-33/+79
2020-02-13parser_fn_front_matter: allow `const .. extern`Mazdak Farrokhzad-45/+50
2020-02-13IsAsync -> enum Async { Yes { span: Span, .. }, No }Mazdak Farrokhzad-4/+12
use new span for better diagnostics.
2020-02-12Rollup merge of #68981 - estebank:silence, r=davidtwcoDylan DPC-6/+6
Account for type params on method without parentheses Account for those type parameters in the structured suggestion when forgetting to call method: ``` error[E0615]: attempted to take value of method `collect` on type `std::vec::IntoIter<_>` --> $DIR/method-missing-parentheses.rs:2:32 | LL | let _ = vec![].into_iter().collect::<usize>; | ^^^^^^^--------- | | | help: use parentheses to call the method: `collect::<usize>()` ```
2020-02-11Auto merge of #68929 - matprec:consistent-issue-references, r=Dylan-DPCbors-4/+4
Make issue references consistent Fixes https://github.com/rust-lang/rust/issues/62976 cc https://github.com/rust-lang/rust/pull/63008 r? @varkor because you reviewed the original pr
2020-02-10review comment: wordingEsteban Küber-6/+6
2020-02-10Rollup merge of #69014 - dwrensha:fix-68890, r=CentrilDylan DPC-0/+24
change an instance of span_bug() to struct_span_err() to avoid ICE After #67148, the `span_bug()` in `parse_ty_tuple_or_parens()` is reachable because `parse_paren_comma_seq()` can return an `Ok()` even in cases where it encounters an error. This pull request prevents an ICE in such cases by replacing the `span_bug()` with `struct_span_error()`. Fixes #68890.
2020-02-09[parser] change an instance of span_bug() to struct_span_err() to avoid ICEDavid Renshaw-0/+24
2020-02-10parser: Keep current and previous tokens preciselyVadim Petrochenkov-2/+2
including their unnormalized forms. Add more documentation for them.
2020-02-09--bless --compare-mode=nllMatthias Prechtl-4/+4
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+22
2020-02-06Rollup merge of #68845 - dwrensha:fix-68783, r=estebankDylan DPC-0/+0
stop using BytePos for computing spans in librustc_parse/parser/mod.rs Computing spans using logic such as `self.token.span.lo() + BytePos(1)` can cause internal compiler errors like #68730 when non-ascii characters are given as input. #68735 partially addressed this problem, but only for one case. Moreover, its usage of `next_point()` does not actually align with what `bump_with()` expects. For example, given the token `>>=`, we should pass the span consisting of the final two characters `>=`, but `next_point()` advances the span beyond the end of the `=`. This pull request instead computes the start of the new span by doing `start_point(self.token.span).hi()`. This matches `self.token.span.lo() + BytePos(1)` in the common case where the characters are ascii, and it gracefully handles multibyte characters. Fixes #68783.
2020-02-05ast_validation: fix visiting bug.Mazdak Farrokhzad-0/+21
2020-02-04stop using BytePos for computing spans in librustc_parse/parser/mod.rsDavid Renshaw-0/+0
2020-02-05parser: merge `fn` grammars wrt. bodies & headersMazdak Farrokhzad-20/+387
also refactor `FnKind` and `visit_assoc_item` visitors
2020-02-03Auto merge of #68735 - JohnTitor:fix-ice-0202, r=estebankbors-0/+0
Use `next_point` to avoid ICE Fixes #68730 r? @estebank (I think you're familiar with that)
2020-02-02Rollup merge of #68764 - Centril:self-semantic, r=petrochenkovMazdak Farrokhzad-4/+365
parser: syntactically allow `self` in all `fn` contexts Part of https://github.com/rust-lang/rust/pull/68728. `self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used. r? @petrochenkov
2020-02-02parser: address review comments re. `self`.Mazdak Farrokhzad-76/+87
2020-02-02parser: move restrictions re. `self` to `ast_validation`.Mazdak Farrokhzad-0/+350
2020-02-02Rollup merge of #68681 - bobrippling:fix-matched-angle-brackets, r=CentrilYuki Okushi-0/+46
Suggest path separator for single-colon typos 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-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