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 listing of lints (eg via -W help) to rustdoc #83895

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

eggyal
Copy link
Contributor

@eggyal eggyal commented Apr 5, 2021

Fixes #83883

r? @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2021
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 5, 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.

Thanks!

src/librustdoc/lib.rs Outdated Show resolved Hide resolved
src/test/rustdoc-ui/issue-83883-describe-lints.rs Outdated Show resolved Hide resolved
@jyn514
Copy link
Member

jyn514 commented Apr 5, 2021

Looks like CI is stuck, but r=me when it's working.

@rust-log-analyzer

This comment has been minimized.

@eggyal eggyal force-pushed the issue-83883 branch 2 times, most recently from dc3f11f to ad86be4 Compare April 6, 2021 07:25
@rust-log-analyzer

This comment has been minimized.

@eggyal eggyal force-pushed the issue-83883 branch 4 times, most recently from 2cb42ba to f805937 Compare April 6, 2021 07:58
@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Apr 6, 2021

@bors r+

This is awesome, thank you! Nice job on normalizing the lint names :)

@bors
Copy link
Contributor

bors commented Apr 6, 2021

📌 Commit 4d23c8e 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2021
@camelid
Copy link
Member

camelid commented Apr 6, 2021

Hmm, won't it be confusing since a lot of rustc lints won't be run by rustdoc? E.g.,

fn main() {
    [1, 2, 3].into_iter();
}

with rustdoc -W array-into-iter foo.rs prints nothing, while a warning is printed when you run it with rustc.

@jyn514
Copy link
Member

jyn514 commented Apr 6, 2021

@camelid you can still enable those lints with -W lint; if you do that for an unknown lint it gives a hard error:

error[E0602]: unknown lint: `x`
  |
  = note: requested on the command line with `-W x`

I think the list of lints enabled by default is separate, maybe we could just document that somewhere.

@jyn514
Copy link
Member

jyn514 commented Apr 6, 2021

with rustdoc -W array-into-iter foo.rs prints nothing, while a warning is printed when you run it with rustc.

Also, this is an implementation detail of how https://doc.rust-lang.org/nightly/rustdoc/advanced-features.html#cfgdoc-documenting-platform-specific-or-feature-specific-information works, it's not guarenteed.

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2021
Rollup of 7 pull requests

Successful merges:

 - rust-lang#82963 (Move `SharedContext` to `context.rs`)
 - rust-lang#83829 (rustc_target: Rely on defaults more in target specs)
 - rust-lang#83895 (Add listing of lints (eg via `-W help`) to rustdoc)
 - rust-lang#83902 (Update LLVM to support more wasm simd ops)
 - rust-lang#83903 (Fix typo in TokenStream documentation)
 - rust-lang#83910 (Update cargo)
 - rust-lang#83920 (Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@camelid
Copy link
Member

camelid commented Apr 6, 2021

I think the list of lints enabled by default is separate, maybe we could just document that somewhere.

Yes, but I think it could be confusing that -W array-into-iter silently does nothing.

@jyn514
Copy link
Member

jyn514 commented Apr 6, 2021

Yes, but I think it could be confusing that -W array-into-iter silently does nothing.

That's separate from this change though, I don't think it should block it.

@bors bors merged commit e00893b into rust-lang:master Apr 6, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 6, 2021
@eggyal eggyal deleted the issue-83883 branch April 6, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Rustdoc ignores -W help
7 participants