-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unneeded rust
as language in rustdoc
's documentation examples
#13604
Comments
Should this be a part of |
Yeah, that may be right, I wasn't sure where to place it (there are other doc-related lints in Clippy already and perhaps |
I think it's actually a better idea to put it into clippy as a style lint because it's completely ok to add |
If someone uses |
Good point: we should ignore doc included with |
What it does
In a documentation example, when processed by
rustdoc
, it is strictly equivalent to writerust
or not (https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html).Thus it would be nice to have a lint that suggest the removal of the unneeded
rust
as language for the example.Some projects may prefer the opposite, i.e. always writing
rust
, thus the equivalent lint for that may be a good idea as well. Either way, consistency is typically an improvement.Advantage
Drawbacks
rustdoc
system.Example
Could be written as:
The text was updated successfully, but these errors were encountered: