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

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

Closed
whitequark opened this issue Aug 11, 2016 · 1 comment
Closed

Comments

@whitequark
Copy link
Member

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)

@eddyb
Copy link
Member

eddyb commented Aug 11, 2016

cc @jseyfried

Manishearth added a commit to Manishearth/rust that referenced this issue Aug 13, 2016
… r=eddyb

Fix incorrect unused import warnings on `cfg_attr`ed `path` attributes

Fixes rust-lang#35584.
r? @eddyb
bors added a commit that referenced this issue Aug 16, 2016
Fix incorrect unused import warnings on `cfg_attr`ed `path` attributes

Fixes #35584.
r? @eddyb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants