-
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
Extra whitespace in nested pub extern #5525
Comments
For anyone interested in working on this here's a little bit of what I found: The To calculate the Line 1784 in 38659ec
Following the calls made after Lines 1977 to 1988 in 38659ec
|
@ytmimi I would like to work on this issue! ✌️ |
@rustbot claim |
@ytmimi in regard to this issue, I noticed that there are several tests with the following format: struct MyTuple(
#[cfg(unix)] // some comment
pub u64,
#[cfg(not(unix))] /*block comment */ pub(crate) u32,
); Is that alright? Or should I correct such tests? |
@jmj0502 Normally changing existing tests isn't something we want to do, but in this case it seems like the bug slipped into those tests. I think it should be fine to update the affected tests, but there's a chance we need to version gate the fix. |
@ytmimi I understand 👍! I asked because the issue truly seems like a bug and there are only two affected tests. However, I think the version gate fix is the way to go, since that won't "break" the format of any existing project. |
Just ran into this myself. type ThisIsAVeryLongTypeNameThatWillCauseWrappingToKickIn = usize;
#[derive(serde_derive::Serialize)]
pub struct Foo(
#[serde(rename = "ThisIsAVeryLongTypeNameThatWillCauseWrappingToKickIn")]
pub ThisIsAVeryLongTypeNameThatWillCauseWrappingToKickIn,
); |
@daprilik I just checked and #5708 should resolve your issue. At the moment the team is focused on higher priority issues like The linked PR is currently waiting on a review. Although maintainers are the only ones who can merge approved PRs anyone in the community is welcome to review and provide feedback on any PR 😁 |
The following snippet formats with an extra space between
pub
andextern "C"
if the arguments continue across multiple lines. i.e. rustfmt producespub␣␣extern "C"
instead ofpub␣extern "C"
.Checked with
The text was updated successfully, but these errors were encountered: