Open jieyouxu opened 4 days ago
(Tagging as C-discussion
status to determine if this is "intended behavior" or "bug" for now.)
To be clear, the way the attributes behave here is IMO the intended way. "forbid" means "cannot be allowed later", so -F unused -A unused
should not allow unused code.
For a given program
Currently (rustc 1.82.0),
rustc -F unused -A unused
will produceHowever, switching to source lint level attributes
will instead produce
This was changed in #67885.
Original issue reported by @RalfJung, this issue is extracted out of #70819 to focus on the difference between rustc cli lint level flags (e.g.
-F..
/-A..
) versus source lint level attributes (e.g.#[forbid(..)]
/#[allow(..)]
).cc @RalfJung could you double-check if my transcription is accurate of what you find surprising/undesirable?