-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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] doesn't work for crate-level attributes #25347
Comments
I'm actually kind of surprised to see this bug. I would have expected |
Also to note, the |
It's a bug/limitation that some special attributes doesn't work with |
It may make sense to move |
@klutzy It looks like the problem is it collects some crate information prior to running the first |
Stripping unconfigured items prior to collecting crate metadata means we can say things like `#![cfg_attr(foo, crate_type="lib")]`. Fixes rust-lang#25347.
Stripping unconfigured items prior to collecting crate metadata means we can say things like `#![cfg_attr(foo, crate_type="lib")]`. Fixes rust-lang#25347.
…hton Stripping unconfigured items prior to collecting crate metadata means we can say things like `#![cfg_attr(foo, crate_type="lib")]`. Fixes #25347.
The
#[cfg_attr]
attribute doesn't work correctly for crate-level attributes. It seems to work in other cases as an inner attribute, but for crate-level attributes it yields the same warning that you'd see if you used the crate attribute on a non-root module:When compiled with
rustc --cfg foo
:The text was updated successfully, but these errors were encountered: