Skip to content

#[cfg_attr(..., path = "...)] produces a spurious unused attribute warning #35584

@whitequark

Description

@whitequark

Ex., this code:

#[cfg_attr(target_arch = "x86",    path = "x86.rs")]
#[cfg_attr(target_arch = "x86_64", path = "x86_64.rs")]
mod imp;

results in this on rustc 1.12.0-nightly (576f76659 2016-08-09):

warning: unused attribute, #[warn(unused_attributes)] on by default
 --> src/arch/mod.rs:7:36
  |
7 | #[cfg_attr(target_arch = "x86",    path = "x86.rs")]
  |                                    ^^^^^^^^^^^^^^^^

(this is when building with target_arch = "x86", of course)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions