You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, an incorrect example was discovered in the libstd documentation.
In this case, the compiler gives a warning for unused results on the I/O operations.
The example should have checked these results, uncovering a bug, which is the file being opened in read-only mode when it was intended to be written to.
If warnings would fail the doc tests, this issue would have been caught automatically.
In case an example wants to explicitly allow "questionable" constructs, it can use the allow(lint) attribute.
The text was updated successfully, but these errors were encountered:
This adds support in rustdoc to blanket apply crate attributes to all doc tests
for a crate at once. The syntax for doing this is:
#![doc(test(attr(...)))]
Each meta item in `...` will be applied to each doctest as a crate attribute.
cc rust-lang#18199
Recently, an incorrect example was discovered in the libstd documentation.
In this case, the compiler gives a warning for unused results on the I/O operations.
The example should have checked these results, uncovering a bug, which is the file being opened in read-only mode when it was intended to be written to.
If warnings would fail the doc tests, this issue would have been caught automatically.
In case an example wants to explicitly allow "questionable" constructs, it can use the
allow(lint)
attribute.The text was updated successfully, but these errors were encountered: