-
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
[unstable option] struct_field_align_threshold #3371
Comments
Two issues I've noticed with this option: First, it interacts poorly with This might be easier to visualize by copying the following examples to an editor with space highlighting. Bad: .push_sized(&fuse_kernel::fuse_out_header {
len: (size_of::<fuse_kernel::fuse_out_header>()
+ fuse_kernel::FUSE_COMPAT_ENTRY_OUT_SIZE
+ size_of::<fuse_kernel::fuse_open_out>()) as u32,
error: 0,
unique: REQUEST_ID,
}) Would be good: .push_sized(&fuse_kernel::fuse_out_header {
len: (size_of::<fuse_kernel::fuse_out_header>()
+ fuse_kernel::FUSE_COMPAT_ENTRY_OUT_SIZE
+ size_of::<fuse_kernel::fuse_open_out>()) as u32,
error: 0,
unique: REQUEST_ID,
}) Secondly, I don't think block-formatted literals should be aligned -- or it should maybe be disable-able. This is how Example of poor formatting: .push_sized(&fuse_kernel::fuse_entry_out {
// ...
entry_valid_nsec: 0,
attr_valid_nsec: 0,
attr: fuse_kernel::fuse_attr {
ino: 11,
..Default::default()
},
}) What I would expect: .push_sized(&fuse_kernel::fuse_entry_out {
// ...
entry_valid_nsec: 0,
attr_valid_nsec: 0,
attr: fuse_kernel::fuse_attr {
ino: 11,
..Default::default()
},
}) |
Is there a similar option for function parameters? |
Will this ever be made available in stable Rust? |
@wusticality please see #5365 |
Thanks for adding this option. An issue I have noticed whilst using it is that the formatting isn't applied when using StandardMaterial {
base_color_texture: Some(asset_server.load("textures/card_back.png")),
cull_mode: Some(Face::Front),
fog_enabled: false,
unlit: true,
alpha_mode: AlphaMode::Blend,
..Default::default()
} whereas I would expect: StandardMaterial {
base_color_texture: Some(asset_server.load("textures/card_back.png")),
cull_mode: Some(Face::Front),
fog_enabled: false,
unlit: true,
alpha_mode: AlphaMode::Blend,
..Default::default()
} |
@theon thanks for sharing. When you have a chance can you create a new issue outlining the problem in more detail. I think it would be best to track this in a separate thread. |
Tracking issue for unstable option: struct_field_align_threshold
The text was updated successfully, but these errors were encountered: