about summary refs log tree commit diff
path: root/compiler/rustc_parse
AgeCommit message (Collapse)AuthorLines
2022-10-18Fix the bug of next_point in spanyukang-4/+4
2022-10-14more dupe word typosRageking8-1/+1
2022-10-12Rollup merge of #102927 - compiler-errors:let, r=davidtwcoDylan DPC-6/+11
Fix `let` keyword removal suggestion in structs (1.) Fixes a bug where, given this code: ```rust struct Foo { let x: i32, } ``` We were parsing the field name as `let` instead of `x`, which causes issues later on in the type-checking phase. (2.) Also, suggestions for `let: i32` as a field regressed, displaying this extra `help:` which is removed by this PR ``` help: remove the let, the `let` keyword is not allowed in struct field definitions | 2 - let: i32, 2 + : i32, ``` (3.) Makes the suggestion text a bit more succinct, since we don't need to re-explain that `let` is not allowed in this position (since it's in a note that follows). This causes the suggestion to render inline as well. cc `@gimbles,` this addresses a few nits I mentioned in your PR.
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-1/+2
2022-10-11Fix let removal suggestion in structMichael Goulet-6/+11
2022-10-11Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgrbors-1/+17
Rollup of 6 pull requests Successful merges: - #101360 (Point out incompatible closure bounds) - #101789 (`let`'s not needed in struct field definitions) - #102846 (update to syn-1.0.102) - #102871 (rustdoc: clean up overly complex `.trait-impl` CSS selectors) - #102876 (suggest candidates for unresolved import) - #102888 (Improve rustdoc-gui search-color test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-10Rollup merge of #101789 - gimbles:let, r=estebankMatthias Krüger-1/+17
`let`'s not needed in struct field definitions Fixes #101683
2022-10-10Fix compiler docsGuillaume Gomez-1/+2
2022-10-10`let` is not allowed in struct field definitionsgimbles-1/+17
Co-authored-by: jyn514 <jyn514@gmail.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2022-10-10Rollup merge of #102345 - chenyukang:fix-102182-impl-trait, r=estebankYuki Okushi-2/+34
Recover from impl Trait in type param bound Fixes #102182 r? ``@estebank``
2022-10-08Stabilize half_open_range_patternsUrgau-1/+0
2022-10-08fix #102182, recover from impl Trait in type param boundyukang-2/+34
2022-10-06Auto merge of #99324 - reez12g:issue-99144, r=jyn514bors-1/+0
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
2022-10-03Invert `is_top_level` to avoid negation.Nicholas Nethercote-5/+5
2022-10-03Remove `TokenStreamBuilder`.Nicholas Nethercote-37/+20
It's now only used in one function. Also, the "should we glue the tokens?" check is only necessary when pushing a `TokenTree::Token`, not when pushing a `TokenTree::Delimited`. As part of this, we now do the "should we glue the tokens?" check immediately, which avoids having look back at the previous token. It also puts all the logic dealing with token gluing in a single place.
2022-10-03Inline and remove `parse_token_tree_non_delim_non_eof`.Nicholas Nethercote-16/+14
It has a single call site.
2022-10-03Merge `parse_token_trees_until_close_delim` and `parse_all_token_trees`.Nicholas Nethercote-24/+17
Because they're very similar, and this will allow some follow-up changes.
2022-10-03Add comments to `TokenCursor::desugar`.Nicholas Nethercote-1/+5
It took me some time to work out what this code was doing.
2022-10-01Rollup merge of #102500 - compiler-errors:parse-sess-cleanup, r=cjgillotMatthias Krüger-3/+5
Remove `expr_parentheses_needed` from `ParseSess` Not sure why this method needed to exist on `ParseSess`, but we can achieve the same behavior by just inlining it everywhere.
2022-10-01Replace some `bool` params with an enumMaybe Waffle-44/+52
2022-10-01Recover wrong cased keywords starting functionsMaybe Waffle-48/+67
2022-10-01recover wrong-cased `use`s (`Use`, `USE`, etc)Maybe Waffle-3/+49
2022-09-30Rollup merge of #102493 - nnethercote:improve-size-assertions-some-more, r=lqdMatthias Krüger-8/+10
Group together more size assertions. Also add a few more assertions for some relevant token-related types. And fix an erroneous comment in `rustc_errors`. r? `@lqd`
2022-10-01Group together more size assertions.Nicholas Nethercote-8/+10
Also add a few more assertions for some relevant token-related types. And fix an erroneous comment in `rustc_errors`.
2022-09-30Rollup merge of #102350 - TaKO8Ki:incomplete-fn-in-struct-definition, ↵Matthias Krüger-11/+17
r=fee1-dead Improve errors for incomplete functions in struct definitions Given the following code: ```rust fn main() {} struct Foo { fn } ``` [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=29139f870511f6918324be5ddc26c345) The current output is: ``` Compiling playground v0.0.1 (/playground) error: functions are not allowed in struct definitions --> src/main.rs:4:5 | 4 | fn | ^^ | = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information error: could not compile `playground` due to previous error ``` In this case, rustc should suggest escaping `fn` to use it as an identifier.
2022-09-30Remove expr_parentheses_needed from ParseSessMichael Goulet-3/+5
2022-09-29Remove from compiler/ cratesreez12g-1/+0
2022-09-29improve E0585 helpRageking8-2/+2
2022-09-28Auto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=davidtwcobors-1253/+1749
Migrate more of rustc_parse to SessionDiagnostic Still far from complete, but I thought I'd add a checkpoint here because rebasing was starting to get annoying.
2022-09-28Auto merge of #102302 - nnethercote:more-lexer-improvements, r=matkladbors-398/+386
More lexer improvements A follow-up to #99884. r? `@matklad`
2022-09-28Address review comments.Nicholas Nethercote-8/+8
2022-09-27Rollup merge of #102284 - compiler-errors:missing-type-in-raw-ptr, r=davidtwcoMatthias Krüger-4/+7
Structured suggestion for missing `mut`/`const` in raw pointer Fixes #102261
2022-09-27Implement IntoDiagnosticArg for rustc_ast::token::Token(Kind)Xiretza-56/+51
2022-09-27Don't unnecessarily stringify paths in diagnosticsXiretza-12/+13
2022-09-27Document use of Symbol::to_string()Xiretza-0/+2
2022-09-27Migrate even more diagnostics in rustc_parse to diagnostic structsXiretza-213/+342
2022-09-27Migrate "struct literal body without path" error to diagnostic structXiretza-16/+29
2022-09-27Migrate "expected semicolon" diagnostics to diagnostic structsXiretza-16/+72
2022-09-27Migrate "expected identifier" diagnostics to diagnostic structsXiretza-43/+154
2022-09-27Rework "inner attribute not permitted" errorsXiretza-58/+58
2022-09-27Remove error condition in parse_attributeXiretza-25/+12
This function is only ever called when the `#` has already been consumed, no need to produce an error message here.
2022-09-27Migrate more rustc_parse diagnostics to diagnostic structsXiretza-155/+156
2022-09-27Move rustc_parse diagnostic structs to separate moduleXiretza-811/+819
2022-09-27Migrate "invalid literal suffix" diagnostic to diagnostic structsXiretza-47/+56
2022-09-27Migrate more diagnostics in rustc_parse to diagnostic structsXiretza-218/+402
2022-09-28improve errors for incomplete functions in struct definitionsTakayuki Maeda-11/+17
2022-09-27Structured suggestion for missing mut/const in pointerMichael Goulet-4/+7
2022-09-27Rename some variables.Nicholas Nethercote-10/+10
These make the delimiter processing clearer.
2022-09-27add a label to struct/enum/union ident nameTakayuki Maeda-10/+26
2022-09-27create a new local varTakayuki Maeda-5/+3