Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWarnings caused by examples in libstd should fail the doc tests #18199
Comments
steveklabnik
added
A-docs
T-rustdoc
labels
Oct 20, 2014
This comment has been minimized.
This comment has been minimized.
|
We definitely want to allow some warnings, like |
This comment has been minimized.
This comment has been minimized.
|
How about allowing dead_code (and perhaps some other things that are commonly valid for examples), and denying everything else by default? |
This comment has been minimized.
This comment has been minimized.
|
The reason warnings weren't happening is that they were actually suppressed. |
steveklabnik
removed
the
A-docs
label
Nov 25, 2014
alexcrichton
self-assigned this
Apr 7, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 8, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 8, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 8, 2015
alexcrichton
closed this
in
ba40231
Apr 10, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
crumblingstatue commentedOct 20, 2014
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.