-
Notifications
You must be signed in to change notification settings - Fork 888
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
Rustfmt removes argument attribute when line is long! #4579
Comments
Simpler snippet, which can be used for repro even with the defaults in the released 1.x versions #[macro_export]
macro_rules! main {
() => {
#[spirv(fragment)]
pub fn main_fs(
mut out_color: ::spirv_std::storage_class::Output<Vec4>,
#[spirv(descriptor_set = 1)] iChannelResolution: ::spirv_std::storage_class::UniformConstant<
[::spirv_std::glam::Vec3A; 4],
>,
) {
}
};
} For anyone interested in working on this, note that it's not reproducible in source on master so be sure any fixes are based on the 1.x branches (current branch at time of this posting would be 1.4.29) |
Can I working on this? I want to have a try. |
Sure! I want to say that subsequent to the last post I've backported some changes that touched the attribute formatting code, so it might be worthwhile to first check whether this can still be reproduced on the latest branch ( |
@calebcartwright Thanks for the comment! I will take a look at the latest branch first. |
I have tested on |
Still happening! Really disturbing to have attributes just disappear on save (I use format-on-save). Had to shorten a variable name to be under the limit. |
Again, still happening. Realized I can just locally use #[rustfmt::skip] , but it's very disconcerting to have rustfmt just break code! |
I'm also affected by this issue. Here's an even simpler repro -
after format -
On nightly 2021-08-07. #[rustfmt::skip] is super helpful in the meantime, I wasn't aware of it! |
This is so much more broken than most of the other issues here that I'm astonished it hasn't got any attention. Sorry for the bump, just a reminder that this is really really bad. |
All - there were a few pieces that needed to be backported to resolve this but it is now done and the fix will be included in whatever the next rustfmt update is (no ETA, but relatively soon). @hrydgard - I appreciate your interest in a resolution and frustration with the bug, but please refrain from making these types of comments on any future threads. Issues which are still open and without updates posted inherently means there are no updates, so the repeated pings just add noise and in some cases can discourage folks from wanting to contribute. Yes, in cases where this bug is hit the severity is pretty high, but it's also not one that seems to occur all that often in practice which is one of the many reasons why this wasn't exactly a number one priority for us. |
I am usually extremely restrictive with bumping issues, but I got breakage because of this for the third time and it looked like it had to be an absolutely trivial issue. Sorry. |
Describe the bug
Rustfmt removes argument attribute when line is long!
To Reproduce
temp.rs
rustfmt temp.rs
#[spirv(descriptor_set = 1)]
attribute from theiChannelResolution
arg!It turns it into this:
Expected behavior
Don't remove any attributes.
Meta
rustfmt 1.4.27-nightly (580d826 2020-11-16)
rustfmt
Settings:
The text was updated successfully, but these errors were encountered: