Stream: rustdoc

Topic: #[deny(rustdoc)] triggers unknown_lints warning when buil...


view this post on Zulip hyd-dev (Mar 05 2021 at 14:08):

Since rustdoc lints have been turned into tool lints, I am being silly :cold_sweat: and looking for a replacement for #![deny(rustdoc)] -- it triggers this in current latest nightly:

warning: unknown lint: `rustdoc`
 --> <anon>:1:9
  |
1 | #![deny(rustdoc)]
  |         ^^^^^^^
  |
  = note: `#[warn(unknown_lints)]` on by default

warning: 1 warning emitted

Apparently it does not work anymore, so... it there a rustdoc::all lint (or a way to achieve the result like that), just like clippy::all?
(Also, similar to clippy::all excluding some Clippy lints like all in clippy::restriction, if rustdoc::all does not exist and needs to be added, I suggest to exclude rustdoc::missing_doc_code_examples from the new lint group -- at least it's annoying to me.)

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:12):

oh huh I would expect that to work

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:13):

oh hold on if you run cargo doc does it warn when documenting? or only when building the crate?

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:13):

I think this happens because the rustdoc group was moved to the tool, not part of the main compiler

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:14):

I think as an alternative I could rename the group to rustdoc::all and add register_renamed

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:15):

I suggest to exclude rustdoc::missing_doc_code_examples from the new lint group -- at least it's annoying to me

I don't know if I like that - I don't think deny(rustdoc) should be making judgements about which lints are better than others, since you explicitly requested to deny all of them

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:18):

you can always allow(rustdoc::missing_examples) if you like

view this post on Zulip hyd-dev (Mar 05 2021 at 14:19):

Sorry I'm being silly :cold_sweat: and miss the fact that it still works for rustdoc:

note: `#[deny(rustdoc::missing_doc_code_examples)]` implied by `#[deny(rustdoc)]`

Joshua Nelson said:

you can always allow(rustdoc::missing_examples) if you like

Yes, I will do that. Thanks!

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:19):

Joshua Nelson said:

I think this happens because the rustdoc group was moved to the tool, not part of the main compiler

yup, that's it:

$ rustdoc rustdoc-group.rs
error: no documentation found for this crate's top-level module
  |
note: the lint level is defined here
 --> rustdoc-group.rs:1:9
  |
1 | #![deny(rustdoc)]
  |         ^^^^^^^
  = note: `#[deny(rustdoc::missing_crate_level_docs)]` implied by `#[deny(rustdoc)]`
  = help: The following guide may be of use:
          https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation.html
$ rustc rustdoc-group.rs
warning: unknown lint: `rustdoc`
 --> rustdoc-group.rs:1:9
  |
1 | #![deny(rustdoc)]
  |         ^^^^^^^
  |
  = note: `#[warn(unknown_lints)]` on by default

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:20):

Joshua Nelson said:

I think as an alternative I could rename the group to rustdoc::all and add register_renamed

working on this now

view this post on Zulip hyd-dev (Mar 05 2021 at 14:22):

hyd-dev said:

Sorry I'm being silly :cold_sweat: and miss the fact that it still works for rustdoc:

note: `#[deny(rustdoc::missing_doc_code_examples)]` implied by `#[deny(rustdoc)]`

Joshua Nelson said:

Joshua Nelson said:

I think as an alternative I could rename the group to rustdoc::all and add register_renamed

working on this now

Actually it's also fine to just make rustc stop warning for #![deny(rustdoc)].

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:23):

Actually it's also fine to make just rustc stop warning for #![deny(rustdoc)].

well I'm not sure how to do that :sweat_smile:

view this post on Zulip hyd-dev (Mar 05 2021 at 14:25):

Joshua Nelson said:

Actually it's also fine to make just rustc stop warning for #![deny(rustdoc)].

well I'm not sure how to do that :sweat_smile:

Then maybe it's really better to just rename it to rustdoc::all... :laughing:
(OTOH, that's consistent with Clippy.)

view this post on Zulip Joshua Nelson (Mar 05 2021 at 14:54):

https://github.com/rust-lang/rust/pull/82798

view this post on Zulip hyd-dev (Mar 05 2021 at 16:13):

Out of curiosity, does renaming the lint group to rustdoc::all need to go through a 10-day FCP?

view this post on Zulip Joshua Nelson (Mar 05 2021 at 16:13):

I'm not sure


Last updated: Oct 11 2021 at 22:34 UTC