Description
In the current Rustdoc Book, it mentions that a few lints are automatically allow
ed in doctests:
Some common
allow
attributes are inserted, includingunused_variables
,unused_assignments
,unused_mut
,unused_attributes
, anddead_code
. Small examples often trigger these lints.
However, as the image above demonstrates, this does not seem to be the case. I have not added any #![doc(test(attr(warn(unused))))]
or similar attributes to my crate, which would override such behavior. These warnings are usually suppressed, but adding --nocapture
when running tests shows these warnings. (It also shows more important warnings, like unused_must_use
, which helped in a different library of mine.)
@rust-lang/docs @rust-lang/dev-tools - Is this a docs issue (which would mean removing this entry from the Rustdoc Book) or a rustdoc issue (which would mean making sure these items are added)?