Description
Here I'll talk about hightly unstable crate-level macro attributes first, but this issue is relevant even on stable because crate level #![cfg(...)]
is also such a macro (sort of), and it is supported since Rust 1.0.
This case caused issues in #108221.
We assume that macros work with token streams.
Implicitly injected extern prelude does not have any token representation, so I conclude that crate-level macro attributes should only receive explicitly written user code as input (collected during token collection as usual).
Now the question is how and when standard library prelude is added to output of a crate level attribute (including #![cfg(FALSE)]
) because eventually it should be added there.
Note: #104633 is a similar issue discussing the fate of #![feature]
attributes on a fully unconfigured crate.