Detect spurious ; before assoc fn body#105369
Merged
bors merged 1 commit intorust-lang:masterfrom Dec 12, 2022
Merged
Conversation
TaKO8Ki
reviewed
Dec 7, 2022
Member
There was a problem hiding this comment.
Suggested change
| // but the actual `token.kind` is `token::CloseDelim(Delimiter::Bracket)`. | |
| // but the actual `token.kind` is `token::CloseDelim(Delimiter::Brace)`. |
I mistakenly wrote Bracket for Brace. Could you fix that instead?
Member
Author
There was a problem hiding this comment.
Ok,I didn't notice it, I will rollback my changes on your part.
I also think TokenTreesReader::parse_token_tree does a very weird thing for this scenario, I had some try to fix it:
#104012 (comment)
currently pending on: #104012
4fa5694 to
5599f2a
Compare
Member
|
@bors r+ rollup |
Collaborator
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Dec 11, 2022
…KO8Ki Detect spurious ; before assoc fn body Fixes rust-lang#105226 r? `@TaKO8Ki`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 11, 2022
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#101648 (Better documentation for env::home_dir()'s broken behaviour) - rust-lang#105283 (Don't call `diagnostic_hir_wf_check` query if we have infer variables) - rust-lang#105369 (Detect spurious ; before assoc fn body) - rust-lang#105472 (Make encode_info_for_trait_item use queries instead of accessing the HIR) - rust-lang#105521 (separate heading from body) - rust-lang#105555 (llvm-wrapper: adapt for LLVM API changes) - rust-lang#105560 (Extend rustdoc hashtag prepended line test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
estebank
reviewed
Dec 12, 2022
Comment on lines
+14
to
+20
| error: associated function in `impl` without body | ||
| --> $DIR/issue-105226.rs:7:5 | ||
| | | ||
| LL | fn hello<P>(&self, val: &P) where P: fmt::Display; { | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ||
| | | | ||
| | help: provide a definition for the function: `{ <body> }` |
Contributor
There was a problem hiding this comment.
Ideally we would also avoid emitting this error by making the parser recover from the spurious ;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #105226
r? @TaKO8Ki