-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not exclusively suggest ;
when ,
is also a choice
#98796
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
;
when ,
is also a choice;
when ,
is also a choice
I'm not quite sure this is an improvement in all cases. E.g. in the regression test: fn main() {
let v = [1
2];
//~^ ERROR expected one of `,`, `.`, `;`, `?`, `]`, or an operator, found `2`
} Does suggesting I think this is something for the diagnostics team to decide. |
Also: Thanks for the PR, @compiler-errors! 😀 |
It doesn't make sense type-wise, but this is parsing, so it's as valid as suggesting We could limit this to just mention |
5071d10
to
9d5c74e
Compare
@estebank do you have some time to look at this PR, or should I re-roll? |
r? diagnostics |
I have to say, I'm not sure this is a net positive, but it's also not a net negative given the output changes are not really worse? @bors r+ |
@estebank: My thought process is that when I could change this if you'd like to say something like |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#98796 (Do not exclusively suggest `;` when `,` is also a choice) - rust-lang#99772 (Re-enable submodule archive downloads.) - rust-lang#100058 (Suggest a positional formatting argument instead of a captured argument) - rust-lang#100093 (Enable unused_parens for match arms) - rust-lang#100095 (More EarlyBinder cleanups) - rust-lang#100138 (Remove more Clean trait implementations) - rust-lang#100148 (RustWrapper: update for TypedPointerType in LLVM) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@compiler-errors honestly, it's fine. What we'd ideally do is try to parse the rest of the expression and start parsing the following node to see which token would have helped, but to do that we need a lot of machinery that we don't currently have. |
Fixes #96791