Skip to content

Commit d50cfd2

Browse files
committed
Auto merge of rust-lang#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`])
2 parents e1871ba + 25ff7ce commit d50cfd2

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

clippy_lints/src/functions/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ declare_clippy_lint! {
9191

9292
declare_clippy_lint! {
9393
/// ### What it does
94-
/// Checks for a [`#[must_use]`] attribute on
94+
/// Checks for a `#[must_use]` attribute on
9595
/// unit-returning functions and methods.
9696
///
97-
/// [`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute
98-
///
9997
/// ### Why is this bad?
10098
/// Unit values are useless. The attribute is likely
10199
/// a remnant of a refactoring that removed the return type.
@@ -112,12 +110,10 @@ declare_clippy_lint! {
112110

113111
declare_clippy_lint! {
114112
/// ### What it does
115-
/// Checks for a [`#[must_use]`] attribute without
113+
/// Checks for a `#[must_use]` attribute without
116114
/// further information on functions and methods that return a type already
117115
/// marked as `#[must_use]`.
118116
///
119-
/// [`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute
120-
///
121117
/// ### Why is this bad?
122118
/// The attribute isn't needed. Not using the result
123119
/// will already be reported. Alternatively, one can add some text to the
@@ -138,11 +134,9 @@ declare_clippy_lint! {
138134
declare_clippy_lint! {
139135
/// ### What it does
140136
/// Checks for public functions that have no
141-
/// [`#[must_use]`] attribute, but return something not already marked
137+
/// `#[must_use]` attribute, but return something not already marked
142138
/// must-use, have no mutable arg and mutate no statics.
143139
///
144-
/// [`#[must_use]`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute
145-
///
146140
/// ### Why is this bad?
147141
/// Not bad at all, this lint just shows places where
148142
/// you could add the attribute.

clippy_lints/src/let_underscore.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
1010

1111
declare_clippy_lint! {
1212
/// ### What it does
13-
/// Checks for `let _ = <expr>`
14-
/// where expr is #[must_use]
13+
/// Checks for `let _ = <expr>` where expr is `#[must_use]`
1514
///
1615
/// ### Why is this bad?
17-
/// It's better to explicitly
18-
/// handle the value of a #[must_use] expr
16+
/// It's better to explicitly handle the value of a `#[must_use]`
17+
/// expr
1918
///
2019
/// ### Example
2120
/// ```rust

0 commit comments

Comments
 (0)