-
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
Gracefully handle mistyping -> as => in function return type #77035
Conversation
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
Might want a crater check if we want make sure it introduces no regressions. |
@lzutao what does crater have to do with this? All this does is improve a diagnostic for code that was already broken. |
This comment has been minimized.
This comment has been minimized.
If every pull request went through crater, we'd never get anything merged, it would take weeks for the smallest change. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes are required but this is definitely an improvement. Please resolve all of the review comments that have been left so far.
You'll also need to run ./x.py fmt
to run rustfmt and pass CI.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
66d758e
to
c297a2e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c297a2e
to
cf94bc6
Compare
cf94bc6
to
3548be9
Compare
Fixed the build and rebased. |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
@mibac138 Great, no regressions, once the review comments are resolved then we can land this! |
This comment has been minimized.
This comment has been minimized.
f475fe5
to
e916641
Compare
@davidtwco Glad to hear! I have now addressed your review comments, so I think this should be good to go now? |
Thanks! @bors r+ |
📌 Commit e916641 has been approved by |
☀️ Test successful - checks-actions |
fn a() -> usize { 0 } | ||
//~^ ERROR return types are denoted using `->` | ||
|
||
fn b()-> usize { 0 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come rustfix does not add a space here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rustfmt doesn't run on the test suite (and shouldn't, because sometimes the tests are for the parser, and the parser should be whitespace-independent).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the output of rustfix? Shouldn't rustfix code output be sightly formatted (at least not as good as rustfmt)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I missed that this is a .fixed
file. This happens because the original doesn't have a space before the :
:
fn b(): usize { 0 }
//~^ ERROR return types are denoted using `->`
Ideally the suggestion would add its own space, yeah.
…where_clause, r=compiler-errors Reject `CVarArgs` in `parse_ty_for_where_clause` Fixes rust-lang#125847. This regressed in rust-lang#77035 where the `parse_ty` inside `parse_ty_where_predicate` was replaced with the at the time new `parse_ty_for_where_clause` which incorrectly stated it would permit CVarArgs (maybe a copy/paste error). r? parser
Fixes #77019