Skip to content

Module declared inside macro is not checked #3253

Open
@mcheshkov

Description

@mcheshkov

When I declare modules like this

#[cfg(unix)]
pub mod stub_hal;

rustfmt will check module, irrespective of condition.

However, when I declare them using cfg-if crate rustfmt doesn't check module.

cfg_if! {
    if #[cfg(unix)] {
        pub mod stub_hal;
    }
}

Is is designed behavior? Or is macro parsing not implemented for now?

That's rustfmt 1.0.1-nightly (be13559 2018-12-10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-macrosa-modsModule resolution.bugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions