New rustdoc lint to respect -Dwarnings correctly#80456
New rustdoc lint to respect -Dwarnings correctly#80456poliorcetics wants to merge 1 commit intorust-lang:masterfrom
Conversation
This adds a new lint to `rustc` that is used in rustdoc when a code block is empty or cannot be parsed as valid Rust code. Previously this was unconditionally a warning. As such some documentation comments were (unknowingly) abusing this to pass despite the `-Dwarnings` used when compiling `rustc`, this should not be the case anymore.
|
Can lints reported by rustdoc be defined entirely in rustdoc without touching I've been seeing numerous lints of uncertain quality being added to rustdoc in the recent year without any process from the compiler or lang team side, while in theory new lints require lang team RFCs or FCPs. |
|
It would certainly be both easier to maintain and less buggy to have everything concentrated in rustdoc but I don't know if it is feasible, I'm especially not knowledgeable about how lints work in the compiler to tell. I'll try to make something work and report my findings. |
|
@poliorcetics please don't make that change here, I would prefer to do it consistently and not piecemeal.
I would like to do that but haven't gotten around to it. The main technical issue is that the old lint names will have to be deprecated and renamed; they can't be deleted, because it's not possible to register built-in lints from out-of-tree (in other words, the new lints will have to be named There's also some debate about which lints should belong to rustdoc and which should be part of rustc: #77364
I didn't know that. Is that written down somewhere? |
|
Closing this in favour of #79816, see there for more infos. |
This adds a new lint to
rustcthat is used in rustdoc when a codeblock is empty or cannot be parsed as valid Rust code.
Previously this was unconditionally a warning. As such some
documentation comments were (unknowingly) abusing this to pass despite
the
-Dwarningsused when compilingrustc, this should not be thecase anymore.
Todo List
src/doc/rustdoc/src/lints.md).rustdoc(file:src/librustdoc/passes/check_code_block_syntax.rs, maybe others).Previously was #79816 but I broke the submodules on my side and it was less trouble fixing it with a new PR that cherry-picked the changes.
Fix #79792.
@rustbot label T-rustdoc A-lint
r? @jyn514