about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-04-22Temporarily accept [i|u][32|size] suffixes on a tuple index and warnEsteban Küber-3/+31
2019-04-23reduce visibilityAleksey Kladov-1/+1
2019-04-23simplify and avoid allocationAleksey Kladov-2/+2
2019-04-23remove obsolete and incorrect commentAleksey Kladov-3/+1
2019-04-21Introduce `ArgSource` for diagnostics.David Wood-4/+6
This commit introduces an `ArgSource` enum that is lowered into the HIR so that diagnostics can correctly refer to the argument pattern's original name rather than the generated pattern.
2019-04-21Do not specify type in generated let bindings.David Wood-6/+7
This avoids issues with `impl_trait_in_bindings` as the type from the argument is normally used as the let binding, but `impl Trait` is unstable in binding position.
2019-04-21Add `AsyncArgument` to AST.David Wood-4/+69
This commit adds an `AsyncArgument` struct to the AST that contains the generated argument and statement that will be used in HIR lowering, name resolution and def collection.
2019-04-21Auto merge of #60124 - petrochenkov:stanomut, r=eddybbors-1/+1
Remove mutability from `Def::Static` Querify `TyCtxt::is_static`. Use `Mutability` instead of bool in foreign statics in AST/HIR. cc https://github.com/rust-lang/rust/pull/60110 r? @eddyb
2019-04-21AST/HIR: Use `Mutability` instead of bool in foreign staticsVadim Petrochenkov-1/+1
2019-04-21Auto merge of #60119 - estebank:bad-recovery, r=davidtwcobors-1/+1
Remove assumption from recovery code Fix #60115.
2019-04-21Introduce `LocalSource` into the AST.David Wood-1/+2
This will be used to keep track of the origin of a local in the AST. In particular, it will be used by `async fn` lowering for the locals in `let <pat>: <ty> = __arg0;` statements.
2019-04-21Auto merge of #60132 - davidtwco:issue-60075, r=estebankbors-1/+6
Fix fn front matter parsing ICE from invalid code. Fixes #60075. This PR fixes an "unreachable code" ICE that results from parsing invalid code where the compiler is expecting the next trait item declaration in the middle of the previous trait item due to extra closing braces. r? @estebank (thanks for the minimized test case)
2019-04-20Auto merge of #59700 - matklad:simplify, r=eddybbors-17/+5
Simplify doc comment lexing is_doc_comment function checks the first four chars, but this is redundant, `doc_comment` local var has the same info.
2019-04-20Fix fn front matter parsing ICE from invalid code.David Wood-1/+6
This commit fixes an "unreachable code" ICE that results from parsing invalid code where the compiler is expecting the next trait item declaration in the middle of the previous trait item due to extra closing braces.
2019-04-19Remove assumption from recovery codeEsteban Küber-1/+1
2019-04-19Some cleanup to `maybe_parse_struct_expr`Vadim Petrochenkov-18/+13
2019-04-19remove duplicated code and simplify logicEsteban Küber-30/+31
2019-04-19Identify missing ambiguous case with best effort suggestionEsteban Küber-4/+4
2019-04-19Emit specific error for struct literal in conditionsEsteban Küber-5/+52
2019-04-17Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddybMazdak Farrokhzad-0/+1
Emit ansi color codes in the `rendered` field of json diagnostics cc @ljedrz Implemented for https://github.com/rust-lang/rust/pull/56595#issuecomment-447645115 (x.py clippy)
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-04Simplify doc comment lexingAleksey Kladov-17/+5
is_doc_comment function checks the first four chars, but this is redundant, `doc_comment` local var has the same info.
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-02Update more unit test to new APIOliver Scherer-0/+1
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