about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-04-12Rollup merge of #59866 - estebank:recover-missing-semi, r=petrochenkovMazdak Farrokhzad-0/+26
Recover from missing semicolon based on the found token When encountering one of a few keywords when a semicolon was expected, suggest the semicolon and recover: ``` error: expected one of `.`, `;`, `?`, or an operator, found `let` --> $DIR/recover-missing-semi.rs:4:5 | LL | let _: usize = () | - help: missing semicolon here LL | LL | let _ = 3; | ^^^ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () | ^^ expected usize, found () | = note: expected type `usize` found type `()` ```
2019-04-12Rollup merge of #59847 - Kampfkarren:try-block-catch, r=estebankMazdak Farrokhzad-1/+9
Error when using `catch` after `try` Part of https://github.com/rust-lang/rust/issues/31436
2019-04-11Auto merge of #59227 - Zoxc:fix-get, r=eddybbors-3/+5
Fix lifetime on LocalInternedString::get function cc @eddyb @nnethercote
2019-04-11review commentsEsteban Küber-16/+15
2019-04-10FeedbackKampfkarren-1/+2
2019-04-10Recover from missing semicolon based on the found tokenEsteban Küber-0/+27
When encountering one of a few keywords when a semicolon was expected, suggest the semicolon and recover: ``` error: expected one of `.`, `;`, `?`, or an operator, found `let` --> $DIR/recover-missing-semi.rs:4:5 | LL | let _: usize = () | - help: missing semicolon here LL | LL | let _ = 3; | ^^^ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () | ^^ expected usize, found () | = note: expected type `usize` found type `()` ```
2019-04-10Adhere to tidy scriptKampfkarren-1/+2
2019-04-10Special error when using catch after tryKampfkarren-1/+7
2019-04-05Rollup merge of #59687 - matklad:shebang, r=petrochenkovMazdak Farrokhzad-11/+5
cleanup shebang handling in the lexer
2019-04-04cleanup shebang handling in the lexerAleksey Kladov-11/+5
2019-04-03make StringReader methods privateAleksey Kladov-2/+2
2019-04-03make StringReader fields privateAleksey Kladov-6/+6
2019-04-01Rollup merge of #59041 - saleemjaffer:trait_doc_comment_better_error_msg, ↵Mazdak Farrokhzad-0/+16
r=pnkfelix fixes rust-lang#56766 fixes #56766
2019-03-31Fix lifetime on LocalInternedString::get functionJohn Kåre Alsaker-3/+5
2019-03-30Rollup merge of #59453 - estebank:recover-tuple-parse, r=petrochenkovMazdak Farrokhzad-26/+57
Recover from parse error in tuple syntax
2019-03-28Deduplicate parse recovery codeEsteban Küber-35/+43
2019-03-29Rollup merge of #59476 - nnethercote:TokenStreamBuilder-SmallVec, r=petrochenkovMazdak Farrokhzad-1/+2
Use `SmallVec` in `TokenStreamBuilder`. This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%. r? @petrochenkov
2019-03-29Use `SmallVec` in `TokenStreamBuilder`.Nicholas Nethercote-1/+2
This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%. It also reduces instruction counts by up to 1.4% across a range of rustc-perf benchmark runs.
2019-03-28Recover from parse error in tuple syntaxEsteban Küber-8/+31
2019-03-28Rollup merge of #59198 - estebank:recovered-pattern, r=zackmdavisMazdak Farrokhzad-1/+1
Do not complain about unmentioned fields in recovered patterns When the parser has to recover from malformed code in a pattern, do not complain about missing fields. Fix #59145.
2019-03-27Rollup merge of #59421 - estebank:tuple-index-suffix, r=petrochenkovJosh Stone-50/+52
Reject integer suffix when tuple indexing Fix #59418. r? @varkor
2019-03-27Rollup merge of #57565 - petrochenkov:turbowarn, r=CentrilJosh Stone-21/+10
syntax: Remove warning for unnecessary path disambiguators `rustfmt` is now stable and it removes unnecessary turbofishes, so removing the warning as discussed in https://github.com/rust-lang/rust/pull/43540 (where it was introduced). One hardcoded warning less. Closes https://github.com/rust-lang/rust/issues/58055 r? @nikomatsakis
2019-03-26Add specific message for tuple struct invoked with suffixed numeric field nameEsteban Küber-1/+2
2019-03-26Reword invalid suffixe errorsEsteban Küber-7/+6
2019-03-26Use `expect_no_suffix` for errorEsteban Küber-8/+1
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-13/+62
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-25review commentsEsteban Küber-1/+1
2019-03-25Reject integer suffix when tuple indexingEsteban Küber-43/+52
2019-03-24Separate variant id and variant constructor id.David Wood-5/+6
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-23Tweak unsupported negative trait bounds messageEsteban Küber-7/+14
2019-03-23syntax: Remove warning for unnecessary path disambiguatorsVadim Petrochenkov-21/+10
2019-03-23Auto merge of #59058 - petrochenkov:assocrecov3, r=estebankbors-88/+82
syntax: Better recovery for `$ty::AssocItem` and `ty!()::AssocItem` This PR improves on https://github.com/rust-lang/rust/pull/46788 covering a few missing cases. Fixes https://github.com/rust-lang/rust/issues/52307 Fixes https://github.com/rust-lang/rust/issues/53776 r? @estebank
2019-03-22Reword type ascription note to reduce verbosityEsteban Küber-5/+1
2019-03-22Review commentEsteban Küber-2/+2
2019-03-22Expand suggestions for type ascription parse errorsEsteban Küber-13/+66
2019-03-22Rollup merge of #59322 - estebank:diag-tweak, r=davidtwcoMazdak Farrokhzad-23/+28
Tweak incorrect escaped char diagnostic
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-10/+20
Do not complain about non-existing fields after parse recovery When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it. Fix #57361.
2019-03-22Auto merge of #59031 - estebank:recover-from-comaless, r=petrochenkovbors-3/+33
Recover from missing comma between enum variants and from bad `pub` kw Fix #56579. Fix #56473.
2019-03-20Tweak incorrect escaped char diagnosticEsteban Küber-23/+28
2019-03-19review commentsEsteban Küber-1/+3
2019-03-18Auto merge of #58872 - rep-nop:diagnostic-fix-56031, r=petrochenkovbors-3/+11
Adds help message in error for invalid `impl for T` syntax Fixes #56031.
2019-03-17Do not complain about non-existing fields after parse recoveryEsteban Küber-10/+18
When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it.
2019-03-16Simplify checkEsteban Küber-5/+1
2019-03-16parse full visibility when recoveringEsteban Küber-5/+9
2019-03-16Recover from incorrect `pub` kw in "reasonable" placesEsteban Küber-1/+13
2019-03-16Recover from missing comma between enum variantsEsteban Küber-2/+20
2019-03-16Fix rebaseVadim Petrochenkov-2/+0
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-3/+2
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16Rename `MetaItem::ident` to `MetaItem::path`Vadim Petrochenkov-4/+4
2019-03-16syntax: Introduce `Ident::can_be_raw`Vadim Petrochenkov-11/+5