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

perpetually increasing indentation #6161

Open
programmerjake opened this issue May 10, 2024 · 0 comments
Open

perpetually increasing indentation #6161

programmerjake opened this issue May 10, 2024 · 0 comments
Labels
a-macros bug Panic, non-idempotency, invalid code, etc.

Comments

@programmerjake
Copy link
Member

trying to format the following code increases the indentation by one level on some of it, every time rustfmt is run, it increases the indentation another level. by running rustfmt repeatedly, I was able to produce line widths of more than 1000.

https://play.rust-lang.org/?version=stable&mode=release&edition=2021&gist=8c150c886832e90a4543a2d3a794d4a6

macro_rules! my_macro {
    ($($tt:tt)*) => {};
}

fn f() {
    my_macro! {
        m =>
        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": r"bbbbbbbbbbbbbbbbbbbbbb
                        cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
",
    };
}
@ytmimi ytmimi added bug Panic, non-idempotency, invalid code, etc. a-macros labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-macros bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

2 participants