Uh oh!
There was an error while loading. Please reload this page.
rustdoc: Make "rust code block is empty" and "could not parse code block" warnings a lint (INVALID_RUST_CODEBLOCKS) - #84587
Conversation
rust-highfive
commented
Apr 26, 2021
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
CraftSpider
commented
Apr 27, 2021
I don't see a test for the actual empty block case, could you add one? Otherwise looks generally good, given that I'm not super familiar with the lint system. |
jyn514
commented
May 1, 2021
It already exists: https://github.com/rust-lang/rust/blob/7f4d7327da6dbec5958d144a12e2e4709ebcbfc1/src/test/rustdoc-ui/invalid-syntax.stderr#L105-L111 Err ... actually I don't think there was ever an FCP in #79816. Also the lint name should be plural, not singular. I'll start FCP once I rename it. |
jyn514
commented
May 1, 2021
@rfcbot fcp merge This adds a new lint I'm open to renaming the lint, but I do think changing these from a warning to a lint is the right decision. |
Team member @jyn514 has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
INVALID_RUST_CODEBLOCKS)There was a problem hiding this comment.
Is there an existing issue about this not pointing to the span that contains the error? Would be nice to fix in the future.
There was a problem hiding this comment.
Why was this behavior changed in this PR?
There was a problem hiding this comment.
The note just moved below the help, it wasn't attached to the correct span before either.
There was a problem hiding this comment.
it wasn't attached to the correct span before either.
Ah, I see 👍
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Why was this behavior changed in this PR?
camelid
commented
May 1, 2021
@rfcbot reviewed I agree with making this a lint, but why was #84587 (comment) changed in this PR? I would prefer it to be a separate change. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rfcbot
commented
May 2, 2021
🔔 This is now entering its final comment period, as per the review above. 🔔 |
…pider rustdoc: Make "rust code block is empty" and "could not parse code block" warnings a lint (`INVALID_RUST_CODEBLOCKS`) Fixesrust-lang#79792. This already went through FCP in rust-lang#79816, so it only needs final review. This is mostly a rebase of rust-lang#79816 - thank you `@poliorcetics` for doing most of the work!
…pider rustdoc: Make "rust code block is empty" and "could not parse code block" warnings a lint (`INVALID_RUST_CODEBLOCKS`) Fixesrust-lang#79792. This already went through FCP in rust-lang#79816, so it only needs final review. This is mostly a rebase of rust-lang#79816 - thank you ``@poliorcetics`` for doing most of the work!
GuillaumeGomez
commented
May 15, 2021
I think it'll need to be rebased: |
jyn514
commented
May 15, 2021
@bors r- |
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.
This also gives a better error message when a span is missing.
- Simplify boolean expression - Give an example of invalid syntax - Remove explanation of why code block is text
This comment has been minimized.
This comment has been minimized.
jyn514
commented
May 18, 2021
@bors r=CraftSpider |
bors
commented
May 18, 2021
📌 Commit 587c504 has been approved by |
…pider rustdoc: Make "rust code block is empty" and "could not parse code block" warnings a lint (`INVALID_RUST_CODEBLOCKS`) Fixesrust-lang#79792. This already went through FCP in rust-lang#79816, so it only needs final review. This is mostly a rebase of rust-lang#79816 - thank you `@poliorcetics` for doing most of the work!
…laumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#84587 (rustdoc: Make "rust code block is empty" and "could not parse code block" warnings a lint (`INVALID_RUST_CODEBLOCKS`)) - rust-lang#85280 (Toggle-wrap items differently than top-doc.) - rust-lang#85338 (Implement more Iterator methods on core::iter::Repeat) - rust-lang#85339 (Report an error if a lang item has the wrong number of generic arguments) - rust-lang#85369 (Suggest borrowing if a trait implementation is found for &/&mut <type>) - rust-lang#85393 (Suppress spurious errors inside `async fn`) - rust-lang#85415 (Clean up remnants of BorrowOfPackedField) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes#79792. This already went through FCP in #79816, so it only needs final review.
This is mostly a rebase of #79816 - thank you @poliorcetics for doing most of the work!