-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
Spawned off of #34932 (comment)
If you put the inner attribute #![cfg(..)]
at a crate root, this (apparently) causes an empty crate to be generated. I.e., it is as if the crate itself still exists, but all of its contents have disappeared.
This is slightly different than the behavior of #![cfg(..)]
elsewhere (e.g. in a mod
item), where such an inner attribute will cause the whole item to be omitted from the AST, rather than just causing the contents of the item to be omitted.
I don't see any mention of this corner case in the Rust documentation for Conditional Compilation, here: https://doc.rust-lang.org/book/conditional-compilation.html
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.