specify how #![cfg(...)]
works differently in the crate root versus anywhere else
#103
Labels
A-attributes
Area: Attributes
Easy
We believe this would not be difficult to actually fix
New Content
Missing features or aspects of language not currently documented.
This is a port of rust-lang/rust#34968.
Since the second edition of the book doesn't have a dedicated section to conditional compilation, it would be worth elaborating on it here. Whether or not that includes porting some of that discussion out is another matter. This issue was more about how an inner cfg attribute creates an empty crate when used in the crate root, but removes the item entirely if used anywhere else. (This is what winapi does to only build on windows, for example.)
The text was updated successfully, but these errors were encountered: