diff options
| author | bors <bors@rust-lang.org> | 2021-10-16 19:07:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-16 19:07:37 +0000 |
| commit | d50cfd26e5fe72afef8dd60adda42faddfe45d91 (patch) | |
| tree | 1dea3ffc1993499173d906c6a738eb1c8341448f | |
| parent | e1871ba0dabf9bf8c2f67e2e781031e2fcd53e6c (diff) | |
| parent | 25ff7ce1283c45a330793ce74cfa5190c4ab68f8 (diff) | |
| download | rust-d50cfd26e5fe72afef8dd60adda42faddfe45d91.tar.gz rust-d50cfd26e5fe72afef8dd60adda42faddfe45d91.zip | |
Auto merge of #7827 - zvavybir:master, r=xFrednet
Fixed naive doc formatting for `#[must_use]` lints The documentation of a few lints around the `#[must_use]` attribute had a few times "[`#[must_use]`]" (without the parentheses, but with the `[]`) and once the "`" was missing. changelog: Fixed naive doc formatting for `#[must_use]` lints ([`must_use_unit`], [`double_must_use`], [`must_use_candidate`], [`let_underscore_must_use`])
| -rw-r--r-- | clippy_lints/src/functions/mod.rs | 12 | ||||
| -rw-r--r-- | clippy_lints/src/let_underscore.rs | 7 |
2 files changed, 6 insertions, 13 deletions
diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs index 04fc5887e8e..d7c5ec9ba35 100644 --- a/clippy_lints/src/functions/mod.rs +++ b/clippy_lints/src/functions/mod.rs @@ -91,11 +91,9 @@ declare_clippy_lint! { declare_clippy_lint! { /// ### What it does - /// Checks for a [`#[must_use]`] attribute on + /// Checks for a `#[must_use]` attribute on /// unit-returning functions and methods. /// - /// [`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute - /// /// ### Why is this bad? /// Unit values are useless. The attribute is likely /// a remnant of a refactoring that removed the return type. @@ -112,12 +110,10 @@ declare_clippy_lint! { declare_clippy_lint! { /// ### What it does - /// Checks for a [`#[must_use]`] attribute without + /// Checks for a `#[must_use]` attribute without /// further information on functions and methods that return a type already /// marked as `#[must_use]`. /// - /// [`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute - /// /// ### Why is this bad? /// The attribute isn't needed. Not using the result /// will already be reported. Alternatively, one can add some text to the @@ -138,11 +134,9 @@ declare_clippy_lint! { declare_clippy_lint! { /// ### What it does /// Checks for public functions that have no - /// [`#[must_use]`] attribute, but return something not already marked + /// `#[must_use]` attribute, but return something not already marked /// must-use, have no mutable arg and mutate no statics. /// - /// [`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute - /// /// ### Why is this bad? /// Not bad at all, this lint just shows places where /// you could add the attribute. diff --git a/clippy_lints/src/let_underscore.rs b/clippy_lints/src/let_underscore.rs index 89146b4dd2c..9efd7aba7e8 100644 --- a/clippy_lints/src/let_underscore.rs +++ b/clippy_lints/src/let_underscore.rs @@ -10,12 +10,11 @@ use rustc_session::{declare_lint_pass, declare_tool_lint}; declare_clippy_lint! { /// ### What it does - /// Checks for `let _ = <expr>` - /// where expr is #[must_use] + /// Checks for `let _ = <expr>` where expr is `#[must_use]` /// /// ### Why is this bad? - /// It's better to explicitly - /// handle the value of a #[must_use] expr + /// It's better to explicitly handle the value of a `#[must_use]` + /// expr /// /// ### Example /// ```rust |
