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
[semicolon_if_nothing_returned
]: add an autofix
#11083
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dswij (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
Thank you.
Can you also help to add the test for autofix?
You'll need to add //@run-rustfix
header at the top of tests/ui/semicolon_if_nothing_returned.rs
.
A .fixed
file will be generated that will result in the test failure. If nothing is weird, you'll need to run the test again with --bless
to copy the generated file as the expected output.
@dswij done, sorry it took that long :) |
[`semicolon_if_nothing_returned`]: add an autofix changelog: [`semicolon_if_nothing_returned`]: add an autofix
💔 Test failed - checks-action_test |
@dswij I updated the initial PR comment to be on only one line |
@bors retry |
[`semicolon_if_nothing_returned`]: add an autofix changelog: [`semicolon_if_nothing_returned`]: add an autofix
💔 Test failed - checks-action_test |
|
||
// No warning | ||
fn let_else_stmts() { | ||
let Some(x) = function_returning_option() else { return; }; |
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.
Seems you'll need to run cargo dev fmt
.
let..else
is now, (finally!), formatted. That seems to be the only issue.
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.
@Centri3
are you sure? cargo dev fmt doesn't make any change on my system
with
rustfmt 1.5.3-nightly (5bd28f5 2023-06-28)
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.
2023-06-28 is pretty old, current rust-toolchain
shows 2023-07-14
and rustfmt -V
rustfmt 1.6.0-nightly (7bd81ee 2023-07-13)
so you'll likely want to git pull upstream master
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.
my bad, rustup didn't updated to this one ?!
should be good now!
@bors retry |
@sylvestre: 🔑 Insufficient privileges: not in try users |
@bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
@sylvestre Thank you for this and @Centri3 for helping Apologies for the slow response at times and the hurdles in merging the PR 😕 |
ouhlala, don't apologize :) this was perfect! |
changelog: [
semicolon_if_nothing_returned
]: add an autofix