about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-11-06Rollup merge of #66098 - estebank:path-asciption-typo, r=CentrilMazdak Farrokhzad-4/+12
Detect `::` -> `:` typo when involving turbofish Fix #65569.
2019-11-06Rollup merge of #66054 - petrochenkov:delspan, r=estebankMazdak Farrokhzad-2/+2
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes https://github.com/rust-lang/rust/issues/62524 r? @estebank
2019-11-05Account for typo in turbofish and suggest `::`Esteban Küber-4/+10
2019-11-05Rollup merge of #66025 - petrochenkov:lohi, r=eddybPietro Albini-1/+1
`Span` cannot represent `span.hi < span.lo` So we can remove the corresponding checks from various code
2019-11-04Detect `::` -> `:` typo when involving turbofishEsteban Küber-1/+3
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-48/+93
Reduce amount of errors given unclosed delimiter When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it on a more granular way in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace. Fix #63690.
2019-11-03syntax: Avoid span arithmetics for delimiter tokensVadim Petrochenkov-2/+2
2019-11-01`Span` cannot represent `span.hi < span.lo`Vadim Petrochenkov-1/+1
So we can remove the corresponding checks from various code
2019-10-31Create new error E0743Guillaume Gomez-2/+5
2019-10-30Do not complain about missing `fn main()` in some casesEsteban Küber-8/+14
2019-10-30Reduce ammount of errors given unclosed delimiterEsteban Küber-44/+83
When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it more granularly in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace.
2019-10-28review commentsEsteban Küber-42/+39
2019-10-28Tweak unexpected token wordingEsteban Küber-5/+5
2019-10-28Use heuristics to recover parsing of missing `;`Esteban Küber-76/+96
- Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon.
2019-10-28Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkovMazdak Farrokhzad-1/+22
rustc, rustc_passes: reduce deps on rustc_expand Part of #65324. r? @petrochenkov
2019-10-27syntax/attr: reduce reliance on parserMazdak Farrokhzad-1/+22
2019-10-26review comments and tweaksEsteban Küber-1/+1
2019-10-25Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwcoMazdak Farrokhzad-19/+20
move report_invalid_macro_expansion_item to item.rs From https://github.com/rust-lang/rust/pull/65324. r? @Mark-Simulacrum
2019-10-25Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwcoMazdak Farrokhzad-2/+3
move Attribute::with_desugared_doc to librustdoc From https://github.com/rust-lang/rust/pull/65324. r? @varkor
2019-10-25Rollup merge of #65787 - Centril:panictry, r=davidtwcoMazdak Farrokhzad-0/+17
move panictry! to where it is used. From https://github.com/rust-lang/rust/pull/65324 r? @davidtwco
2019-10-25move report_invalid_macro_expansion_item to item.rsMazdak Farrokhzad-19/+20
2019-10-25move Attribute::with_desugared_doc to librustdocMazdak Farrokhzad-2/+3
2019-10-25move panictry! to where it is used.Mazdak Farrokhzad-0/+17
2019-10-24pre-expansion gate type_ascriptionMazdak Farrokhzad-0/+1
2019-10-24pre-expansion gate box_syntaxMazdak Farrokhzad-1/+3
2019-10-24pre-expansion gate label_break_valueMazdak Farrokhzad-0/+4
2019-10-24pre-expansion gate try_blocksMazdak Farrokhzad-1/+3
2019-10-24pre-expansion gate exclusive_range_patternMazdak Farrokhzad-2/+7
2019-10-24pre-expansion gate box_patternsMazdak Farrokhzad-1/+3
2019-10-24pre-expansion gate decl_macroMazdak Farrokhzad-0/+5
2019-10-24pre-expansion gate const_genericsMazdak Farrokhzad-0/+4
2019-10-24pre-expansion gate crate_visibility_modifierMazdak Farrokhzad-0/+1
2019-10-24pre-expansion gate associated_type_boundsMazdak Farrokhzad-2/+10
2019-10-24pre-expansion gate trait_alias.Mazdak Farrokhzad-0/+2
2019-10-24syntax: reject `trait Foo: Bar = Baz;`.Mazdak Farrokhzad-8/+20
Add test for rejecting `trait A: B1 = B2;`. Also test rejection of `trait A: = B;`.
2019-10-23Rollup merge of #65686 - yjhmelody:yjhmelody-patch-1, r=CentrilYuki Okushi-9/+8
refactor and move `maybe_append`
2019-10-22refactor maybe_appendyjhmelody-9/+8
2019-10-18Rollup merge of #65552 - JohnTitor:use-bitwise-not, r=Dylan-DPCTyler Mandry-1/+1
Clarify diagnostics when using `~` as a unary op It seems we prefer `bitwise not` to `bitwise negation`. Fixes #57239 r? @estebank
2019-10-18Rollup merge of #65455 - ↵Tyler Mandry-11/+10
nnethercote:avoid-unnecessary-TokenTree-to-TokenStream-conversions, r=petrochenkov Avoid unnecessary `TokenTree` to `TokenStream` conversions A `TokenStream` contains any number of `TokenTrees`. Therefore, a single `TokenTree` can be promoted to a `TokenStream`. But doing so costs two allocations: one for the single-element `Vec`, and one for the `Lrc`. (An `IsJoint` value also must be added; the default is `NonJoint`.) The current code converts `TokenTree`s to `TokenStream`s unnecessarily in a few places. This PR removes some of these unnecessary conversions, both simplifying the code and speeding it up. r? @petrochenkov
2019-10-18Rollup merge of #65364 - XiangQingW:master, r=estebankTyler Mandry-3/+20
Collect occurrences of empty blocks for mismatched braces diagnostic Fix #63904
2019-10-18Clarify diagnostics when using `~` as a unary opYuki Okushi-1/+1
2019-10-18Change `Lit::tokens()` to `Lit::token_tree()`.Nicholas Nethercote-9/+8
Because most of the call sites have an easier time working with a `TokenTree` instead of a `TokenStream`.
2019-10-18Remove two no-op `into()` calls.Nicholas Nethercote-2/+2
2019-10-16ui-fulldeps: make them pass again?Mazdak Farrokhzad-3/+3
2019-10-16make tidy happyMazdak Farrokhzad-3/+13
2019-10-16parser: leave a FIXME for laterMazdak Farrokhzad-0/+2
2019-10-16move SeqSep to parser.rsMazdak Farrokhzad-30/+31
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-30/+30
2019-10-16syntax::parse: don't depend on syntax::extMazdak Farrokhzad-6/+12
2019-10-16syntax: reduce visibilitiesMazdak Farrokhzad-97/+97