-
Notifications
You must be signed in to change notification settings - Fork 926
BraceStyle AlwaysNewLine for unsafe blocks #4422
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
BraceStyle AlwaysNewLine for unsafe blocks #4422
Conversation
Yikes! You've found a bug we've had in source for months where empty |
* Unsafe blocks can now get an opening brace on a new line * Add test case for unsafe blocks
798a007
to
827080a
Compare
I force pushed on my branch, don't know if this is how you prefer to handle amends... sorry about that :/ |
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 for the PR!
Historically, brace_style
configuration option only applied to braces of items (e.g., function, struct, enum, impl...). I don't remember that if this is intentional or we just forgot to implement it, but either way I think the PR's approach is more natural.
Hey, Thanks for your time and the review :) The brace_style and control_brace_style are marked as unstable, is there a place listing what's missing to make it available in stable rustfmt ? Cheers |
No worries! We don't strictly enforce or require anything so it doesn't matter all that much. As far as personal preference, I find it easier to review updates when the changes are provided in a separate commit. We can always squash things up as needed before a merge too.
Absolutely, and thanks for the PR!
The requirements and process for stabilizing a rustfmt config option can be found here. I'd imagine both of those options are relative close (though haven't crawled through the issue tracker to see if there's any open bugs yet), though the need for this PR is evidence some things may still be missing for at least |
And accordingly a I'm going to go ahead and merge this as it's in good order and solves the issue, and will open a couple issues for the related follow ups (including updating the Config docs). Let us know if you're interested in working on those or any other issues @IceTDrinker! |
@calebcartwright absolutely interested in helping making those features stable :) and for other things the different Rust projects might need |
Fantastic! #4428 would be a good option on both fronts, as it also ties into |
Unsafe blocks can now get an opening brace on a new line
Add test case for unsafe blocks
Hello relating to this issue : #3376 and this issue : #3377
All comments or suggestions are very welcome, I'm far from being a rust pro :)
Cheers