Skip to content

Commit 7237e86

Browse files
committed
Reword suggestion messages.
1 parent cdf6606 commit 7237e86

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_lint/src/let_underscore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ fn build_and_emit_lint(
150150
lint.build(msg)
151151
.span_suggestion_verbose(
152152
local.pat.span,
153-
"consider binding to an unused variable",
153+
"consider binding to an unused variable to avoid immediately dropping the value",
154154
"_unused",
155155
Applicability::MachineApplicable,
156156
)
157157
.multipart_suggestion(
158-
"consider explicitly droping with `std::mem::drop`",
158+
"consider immediately dropping the value",
159159
vec![
160160
(init_span.shrink_to_lo(), "drop(".to_string()),
161161
(init_span.shrink_to_hi(), ")".to_string()),

src/test/ui/lint/let_underscore/let_underscore_drop.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ LL | let _ = NontrivialDrop;
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: requested on the command line with `-W let-underscore-drop`
8-
help: consider binding to an unused variable
8+
help: consider binding to an unused variable to avoid immediately dropping the value
99
|
1010
LL | let _unused = NontrivialDrop;
1111
| ~~~~~~~
12-
help: consider explicitly droping with `std::mem::drop`
12+
help: consider immediately dropping the value
1313
|
1414
LL | let _ = drop(NontrivialDrop);
1515
| +++++ +

src/test/ui/lint/let_underscore/let_underscore_lock.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ LL | let _ = data.lock().unwrap();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[deny(let_underscore_lock)]` on by default
8-
help: consider binding to an unused variable
8+
help: consider binding to an unused variable to avoid immediately dropping the value
99
|
1010
LL | let _unused = data.lock().unwrap();
1111
| ~~~~~~~
12-
help: consider explicitly droping with `std::mem::drop`
12+
help: consider immediately dropping the value
1313
|
1414
LL | let _ = drop(data.lock().unwrap());
1515
| +++++ +

0 commit comments

Comments
 (0)