-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Blocks for items #1991
Comments
With https://github.com/alexcrichton/cfg-if you can make it look like: #[macro_use] extern crate cfg_if;
cfg_if! {
if #[cfg(feature = "abc")] {
extern crate x;
extern crate y;
mod z;
use z::{a, b, c};
}
} |
@withoutboats Would anonymous modules do this? As something like #[cfg(feature = "abc")]
mod {
extern crate x;
extern crate y;
mod z;
use z::{a, b, c};
} |
I considered anonymous modules, but the main issue is that things like |
@clarcharr it's actually a pattern, albeit an uncommon one, to put extern crates in submodules. |
@ubsan wait, is that actually allowed? huh. |
I think this is #2377 so I'm closing in favor of that. |
It'd be really nice if we could do something like:
Right now, we have to attach the attribute to every item, which is a bit redundant. We can put things in a module and then re-export them, but it'd be nice if we could do something like this instead.
The text was updated successfully, but these errors were encountered: