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

Rustdoc does not warn about unknown, renamed, or removed lints #75884

Closed
jyn514 opened this issue Aug 24, 2020 · 2 comments · Fixed by #75903
Closed

Rustdoc does not warn about unknown, renamed, or removed lints #75884

jyn514 opened this issue Aug 24, 2020 · 2 comments · Fixed by #75903
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Aug 24, 2020

Found in tokio-rs/tracing#940 (comment).

$ cat broken.rs 
#![deny(x)]
$ rustdoc broken.rs  # no output
$ rustc broken.rs 
warning: unknown lint: `x`
 --> broken.rs:1:9
  |
1 | #![deny(x)]
  |         ^
  |
  = note: `#[warn(unknown_lints)]` on by default
$ rustdoc --version
rustdoc 1.45.2 (d3fb005a3 2020-07-31)
@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. labels Aug 24, 2020
@jyn514
Copy link
Member Author

jyn514 commented Aug 24, 2020

renamed_and_unknown_lints is also not running, which is even worse in this case because it means no one will see the message about intra-doc links being renamed.

$ rustc +nightly broken.rs  --crate-type lib
warning: lint `intra_doc_link_resolution_failure` has been renamed to `broken_intra_doc_links`
 --> broken.rs:1:9
  |
1 | #![deny(intra_doc_link_resolution_failure)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `broken_intra_doc_links`
  |
  = note: `#[warn(renamed_and_removed_lints)]` on by default
$ rustdoc +nightly broken.rs  # no output

@jyn514 jyn514 changed the title Rustdoc does not warn about unknown lints Rustdoc does not warn about unknown, renamed, or removed lints Aug 24, 2020
@jyn514
Copy link
Member Author

jyn514 commented Aug 25, 2020

Relevant code:

rust/src/librustdoc/core.rs

Lines 225 to 228 in 6e3e74d

/// This function is used to setup the lint initialization. By default, in rustdoc, everything
/// is "allowed". Depending if we run in test mode or not, we want some of them to be at their
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTES" lint is activated in both
/// modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant