Skip to content

#[cfg_attr(rustfmt, rustfmt::skip::macros(...))] does not work #4156

Closed
@tmandry

Description

@tmandry

Using #[rustfmt::skip::macros(gen)] successfully skips formatting in the following example. So does #[cfg_attr(rustfmt, rustfmt::skip)]. But combining these into #[cfg_attr(rustfmt, rustfmt::skip::macros(gen))] fails.

This also applies for #! attribute declarations. I want to use cfg_attr to avoid "unused attribute" lints on these.

Playground

fn example() {
    gen!(f, "
        trait $trait_name {
            fn $func_name(self, $args_sig);
        }
    ")?;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions