rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
5.97k stars 879 forks source link

Unexpected extra space in multi-line tuple struct with `pub` #6349

Closed jrose-signal closed 3 hours ago

jrose-signal commented 3 hours ago
pub struct MyService(
    pub  dependency::Multi<
        Arc<dyn dependency::ServiceWithDebugInfo + Send + Sync>,
        Arc<dyn dependency::ServiceWithDebugInfo + Send + Sync>,
    >,
);

I realize this is kind of a terrible type to begin with, but the extra space after the pub for the field was unexpected. If there's a reason for it, though, please close this!

ytmimi commented 3 hours ago

Duplicate of https://github.com/rust-lang/rustfmt/issues/5703, https://github.com/rust-lang/rustfmt/issues/5525, https://github.com/rust-lang/rustfmt/issues/5997

jrose-signal commented 3 hours ago

🤦 I searched "tuple struct space" and "tuple struct pub". Thanks.