Rust-clippy: New lint: missing_panic_doc

Created on 8 Dec 2020  路  4Comments  路  Source: rust-lang/rust-clippy

What it does

Checks for missing documentation.

Lints

  • Module not documented.
  • Trait not documented.
  • Trait method not documented.
  • Enum not documented.
  • Enum variant not documented.
  • Struct not documented.
  • Struct method not documented.
  • Function not documented.
  • Panic not documented.
  • README.md missing.
L-lint good-first-issue

Most helpful comment

I think these are detected by missing_doc and missing_docs_in_private_items that @giraffate mentioned.

Yep, you can check this in the playground.

Panic not documented.

As Clippy has a similar lint for functions that return errors, I think it makes sense to have a lint for functions that may panics.

There's also missing_safety_doc. I think it makes sense to add a lint for this. Since it's the only remaining case that it's not currently linted, I will change also the description of the issue to reflect that.

All 4 comments

FYI rustc has a missing_doc lint and Clippy has a missing_docs_in_private_items.

  • Panic not documented.

As Clippy has a similar lint for functions that return errors, I think it makes sense to have a lint for functions that may panics.

  • Module not documented.
  • Trait not documented.
  • Trait method not documented.
  • Enum not documented.
  • Enum variant not documented.
  • Struct not documented.
  • Struct method not documented.
  • Function not documented.

I think these are detected by missing_doc and missing_docs_in_private_items that @giraffate mentioned.

  • README.md missing.

I think this is covered by cargo_common_metadata. (aside from whether it will be used for this purpose)

I think these are detected by missing_doc and missing_docs_in_private_items that @giraffate mentioned.

Yep, you can check this in the playground.

Panic not documented.

As Clippy has a similar lint for functions that return errors, I think it makes sense to have a lint for functions that may panics.

There's also missing_safety_doc. I think it makes sense to add a lint for this. Since it's the only remaining case that it's not currently linted, I will change also the description of the issue to reflect that.

Duplicates #1974

Was this page helpful?
0 / 5 - 0 ratings