This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
src/test/ui/lint/let_underscore Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff 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( ) ) ,
Original file line number Diff line number Diff 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 |
1010LL | let _unused = NontrivialDrop;
1111 | ~~~~~~~
12- help: consider explicitly droping with `std::mem::drop`
12+ help: consider immediately dropping the value
1313 |
1414LL | let _ = drop(NontrivialDrop);
1515 | +++++ +
Original file line number Diff line number Diff 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 |
1010LL | let _unused = data.lock().unwrap();
1111 | ~~~~~~~
12- help: consider explicitly droping with `std::mem::drop`
12+ help: consider immediately dropping the value
1313 |
1414LL | let _ = drop(data.lock().unwrap());
1515 | +++++ +
You can’t perform that action at this time.
0 commit comments