Skip to content
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

Bug/quirk: newline inconsistencies in argument list #5987

Closed
samtay opened this issue Dec 22, 2023 · 1 comment · Fixed by #5989
Closed

Bug/quirk: newline inconsistencies in argument list #5987

samtay opened this issue Dec 22, 2023 · 1 comment · Fixed by #5989
Labels

Comments

@samtay
Copy link
Contributor

samtay commented Dec 22, 2023

It seems odd that these are inconsistent, especially since trace and debug are both five letter words:

use log::{debug, trace};

pub fn main() {
    trace!(
        "get some longer length in here yes yes {} {}",
        "hello",
        "world"
    );
    debug!(
        "get some longer length in here yes yes {} {}",
        "hello", "world"
    );
}

Notice the newline present in the trace arguments, but not in the debug arguments. Other functions seem to follow the same format as the former; perhaps this is something specific with debug? Not sure why that would be 🤷

Versions tested:

  • stable: rustfmt 1.6.0-stable (a28077b 2023-12-04)
  • nightly: rustfmt 1.7.0-nightly (3d0e6be 2023-12-21)
@ytmimi
Copy link
Contributor

ytmimi commented Dec 22, 2023

Looks like we forgot about trace! 😅

rustfmt/src/overflow.rs

Lines 46 to 51 in d739d93

// From the `log` crate.
("debug!", 0),
("error!", 0),
("info!", 0),
("warn!", 0),
// write! like macros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants