Closed
Description
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.