Skip to content

Fix bug in rustdoc -Whelp - #98799

Merged
bors merged 1 commit into
rust-lang:masterfrom
jyn514:rustdoc-lint-help
Jul 4, 2022
Merged

Fix bug in rustdoc -Whelp#98799
bors merged 1 commit into
rust-lang:masterfrom
jyn514:rustdoc-lint-help

Conversation

@jyn514

@jyn514jyn514 commented Jul 2, 2022

Copy link
Copy Markdown
Member

Previously, this printed the debugging options, not the lint options,
and only handled -Whelp, not -A/-D/-F.

This also fixes a few other misc issues:

  • Fix // check-stdout for UI tests; previously it only worked for run-fail and compile-fail tests
  • Add lint headers for tool lints, not just builtin lints

#98533 (comment)

r? @GuillaumeGomez

@jyn514jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. labels Jul 2, 2022
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2022
Comment threadsrc/tools/compiletest/src/runtest.rs Outdated

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

before, // check-stdout was broken and did nothing for UI tests

@rust-log-analyzer

This comment has been minimized.

@jyn514
jyn514force-pushed the rustdoc-lint-help branch 2 times, most recently from 564518d to fa39bd4CompareJuly 2, 2022 06:23
Comment threadsrc/librustdoc/lib.rs Outdated
Comment on lines 777 to 786

@jyn514jyn514Jul 2, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

this can't just be register_plugins() because that ends up trying to parse the source file, which fails because it's an empty string. this code is taken from

if sopts.describe_lints{
letmut lint_store = rustc_lint::new_lint_store(
sopts.debugging_opts.no_interleave_lints,
compiler.session().unstable_options(),
);
let registered_lints =
ifletSome(register_lints) = compiler.register_lints(){
register_lints(compiler.session(),&mut lint_store);
true
}else{
false
};
describe_lints(compiler.session(),&lint_store, registered_lints);
return;
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

this ended up fixing my original complaint in #98533 (comment) :)

@jyn514
jyn514force-pushed the rustdoc-lint-help branch from fa39bd4 to 56b512bCompareJuly 2, 2022 06:35
Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.
This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints
- Remove duplicate run-make test
@jyn514
jyn514force-pushed the rustdoc-lint-help branch from 56b512b to 17da4e0CompareJuly 2, 2022 07:12
@GuillaumeGomez

Copy link
Copy Markdown
Member

Just to be sure: there are other UI tests that check the output you removed?

@jyn514

Copy link
Copy Markdown
MemberAuthor

Yes, you can see them in the diff: src/test/rustdoc-ui/issue-83883-describe-lints.rs
The run-make test did the same thing and couldn't be blessed, so it would have to be manually updated on each new lint.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@bors

bors commented Jul 3, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 17da4e0 has been approved by GuillaumeGomez

@borsbors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 3, 2022
…meGomez
Fix bug in `rustdoc -Whelp`
Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.
This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints
rust-lang#98533 (comment)
r? `@GuillaumeGomez`
RalfJung added a commit to RalfJung/rust that referenced this pull request Jul 3, 2022
…meGomez
Fix bug in `rustdoc -Whelp`
Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.
This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints
rust-lang#98533 (comment)
r? ``@GuillaumeGomez``
This was referenced Jul 3, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2022
Rollup of 4 pull requests
Successful merges:
- rust-lang#94831 (Link to stabilization section in std-dev-guide for library tracking issue template)
- rust-lang#98764 (add Miri to the nightly docs)
- rust-lang#98773 (rustdoc: use <details> tag for the source code sidebar)
- rust-lang#98799 (Fix bug in `rustdoc -Whelp`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit ce76d73 into rust-lang:masterJul 4, 2022
@rustbotrustbot added this to the 1.64.0 milestone Jul 4, 2022
@jyn514
jyn514 deleted the rustdoc-lint-help branch February 25, 2023 18:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant 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

@jyn514@rust-log-analyzer@GuillaumeGomez@bors@rust-highfive@rustbot