Uh oh!
There was an error while loading. Please reload this page.
Improve parser diagnostics - #95211
Conversation
rust-highfive
commented
Mar 22, 2022
(rust-highfive has picked a reviewer for you, use r? to override) |
aa01a0b to
3f8fdb7Compareterrarier2111
commented
Mar 22, 2022
could you take a look at this cuz i took some inspiration from your comments and you seemed to be interested in smth like this as well? |
compiler-errors
commented
Mar 22, 2022
I cannot r+ this (and hence high-five bot didn't assign me), but I will certainly take a look! |
compiler-errors
commented
Mar 22, 2022
lol, nvm, highfive-bot does not care about bors permissions apparently. anywho, I cannot approve this for you, so I will reassign this to someone who can. I will try to give it a review though! r? rust-lang/compiler |
jackh726
commented
Mar 22, 2022
@bors delegate=compiler-errors @compiler-errors if you want to review this, go for it (I'll try to look at this regardless later today) |
bors
commented
Mar 22, 2022
✌️ @compiler-errors can now approve this pull request |
7bd0c28 to
2ae9da9Compare
compiler-errors
left a comment
There was a problem hiding this comment.
I am concerned with a regression in parsing fn foo() where {}. Also left a few other comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
It is somewhat misleading to call this a "token"
There was a problem hiding this comment.
What name would you suggest, i am willing to adjust this
There was a problem hiding this comment.
Can you special-case this for certain tokens?
Also, not sure if the suggestion to remove a comment is useful here, since comments are usually intentionally placed. This one might be better fixed with a separate suggestion.
There was a problem hiding this comment.
Can you special-case this for certain tokens?
Also, not sure if the suggestion to remove a comment is useful here, since comments are usually intentionally placed. This one might be better fixed with a separate suggestion.
Oh, yea i can special case different token kinds and i can ignore comments i think
There was a problem hiding this comment.
Okay, so i made it vary based on the kind of token
Uh oh!
There was an error while loading. Please reload this page.
terrarier2111
commented
Mar 22, 2022
I fixed this regression by downgrading the diagnostic from an error to a warning |
e57b61b to
0839c08Compare
This comment has been minimized.
This comment has been minimized.
compiler-errors
commented
Mar 22, 2022
@terrarier2111, is it too much work to split this up into several commits? We might want to land some of these diagnostics separately, possibly so it's easier to git-bisect later on, and because they are varying levels of opinionated. Or at least, several commits might be easier to review. For example, I could see the |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Do you mind leaving comments explaining what this logic is checking for? Also, perhaps using return might help tighten some of the if-else blocks.
There was a problem hiding this comment.
I left some comments there and used returns, do the comments suffice?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
terrarier2111
commented
Mar 24, 2022
Do you mean splitting these commits in different prs or just having multiple commits in this pr? |
5f29e26 to
a1df86eCompare
This comment has been minimized.
This comment has been minimized.
bors
commented
Mar 27, 2022
☔ The latest upstream changes (presumably #94495) made this pull request unmergeable. Please resolve the merge conflicts. |
compiler-errors
left a comment
There was a problem hiding this comment.
Sorry for taking some time to get back to this. I have a couple of comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d5e2166 to
637ce71CompareUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
can you double check if the parser has other self.token == use cases that can be turned into check_noexpect?
There was a problem hiding this comment.
I don't think that i am able to do that as from what I was able to see that would require a decent amount of work and I just wanted to finish up the changes in this pr.
compiler-errors
commented
Jun 6, 2022
@terrarier2111, heads up that PRs should not include merge commits: https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy |
@compiler-errors Yea, i know i wanted to finish this later |
7a47722 to
70589baComparecompiler-errors
commented
Jun 6, 2022
Heads up that you messed up the commit log I think: https://github.com/rust-lang/rust/pull/95211/commits |
terrarier2111
commented
Jun 6, 2022
Oh.. yea how could I solve this problem? |
compiler-errors
commented
Jun 6, 2022
perhaps |
70589ba to
2fd7808Compareterrarier2111
commented
Jun 6, 2022
Okay, well so i tried fixing it and actually made it worse :c |
compiler-errors
commented
Jun 6, 2022
I'm not sure if I can help -- I'm not familiar with the |
2fd7808 to
c88e4fbCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ecbeac0 to
21fdd54Compareterrarier2111
commented
Jun 13, 2022
@compiler-errors do I have to do anything else for this to be good to go? |
compiler-errors
commented
Jun 13, 2022
This looks fine enough to merge now. Maybe we actually don't need the noexpect methods, but those are easy to remove. @bors r+ |
bors
commented
Jun 13, 2022
📌 Commit 21fdd54 has been approved by |
Rollup of 4 pull requests Successful merges: - rust-lang#95211 (Improve parser diagnostics) - rust-lang#95243 (Add Apple WatchOS compile targets) - rust-lang#97385 (Add WIP stable MIR crate) - rust-lang#97508 (Harden bad placeholder checks on statics/consts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This pr fixes#93867 and contains a couple of diagnostics related changes to the parser.
Here is a short list with some of the changes:
If any of these changes are undesirable, i can remove them, thanks!