Skip to content
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

Add suggestion for "ignore" doc code block #80580

Merged

Conversation

GuillaumeGomez
Copy link
Member

Part of #30032.

This PR adds a suggestion to help users when they have a "ignore" doc code block which is invalid rust code.

r? @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 1, 2021
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.channel         := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
Checking which error codes lack tests...
Found 435 error codes
Found 0 error codes with no tests
Done!
tidy error: /checkout/src/test/rustdoc-ui/ignore-block-help.rs:3: unexplained "```ignore" doctest; try one:

* make the test actually pass, by adding necessary imports and declarations, or
* use "```text", if the code is not Rust code, or
* use "```compile_fail,Ennnn", if the code is expected to fail at compile time, or
* use "```should_panic", if the code is expected to fail at run time, or
* use "```no_run", if the code should type-check but not necessary linkable/runnable, or
* explain it like "```ignore (cannot-test-this-because-xxxx)", if the annotation cannot be avoided.

some tidy checks failed


@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 1, 2021
@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 1, 2021
@GuillaumeGomez GuillaumeGomez force-pushed the suggestion-ignore-codeblock-warn branch from 113caf6 to c3ae826 Compare January 1, 2021 15:34
@GuillaumeGomez
Copy link
Member Author

Updated!

@GuillaumeGomez GuillaumeGomez added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 1, 2021
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with or without fixing the nit

src/librustdoc/html/markdown.rs Show resolved Hide resolved
@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 3, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 3, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Jan 3, 2021

📌 Commit 7bc1eb4 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 3, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 3, 2021
…laumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#80580 (Add suggestion for "ignore" doc code block)
 - rust-lang#80591 (remove allow(incomplete_features) from std)
 - rust-lang#80617 (Detect invalid rustdoc test commands)
 - rust-lang#80628 (reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats))
 - rust-lang#80646 (Clean up in `each_child_of_item`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2686daa into rust-lang:master Jan 3, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 3, 2021
@GuillaumeGomez GuillaumeGomez deleted the suggestion-ignore-codeblock-warn branch January 3, 2021 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants