Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions compiler/rustc_lint/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,7 @@ pub(crate) struct UnusedOp<'a> {
#[derive(Subdiagnostic)]
pub(crate) enum UnusedOpSuggestion {
#[suggestion(
"use `let _ = ...` to ignore the resulting value",
"if you wish to disregard this recommendation, use `let _ = ...` to ignore the value",
style = "verbose",
code = "let _ = ",
applicability = "maybe-incorrect"
Expand All @@ -2623,7 +2623,7 @@ pub(crate) enum UnusedOpSuggestion {
span: Span,
},
#[multipart_suggestion(
"use `let _ = ...` to ignore the resulting value",
"if you wish to disregard this recommendation, use `let _ = ...` to ignore the value",
style = "verbose",
applicability = "maybe-incorrect"
)]
Expand Down Expand Up @@ -2687,7 +2687,7 @@ pub(crate) struct UnusedDef<'a, 'b> {
#[derive(Subdiagnostic)]
pub(crate) enum UnusedDefSuggestion {
#[suggestion(
"use `let _ = ...` to ignore the resulting value",
"if you wish to disregard this recommendation, use `let _ = ...` to ignore the value",
style = "verbose",
code = "let _ = ",
applicability = "maybe-incorrect"
Expand All @@ -2697,7 +2697,7 @@ pub(crate) enum UnusedDefSuggestion {
span: Span,
},
#[multipart_suggestion(
"use `let _ = ...` to ignore the resulting value",
"if you wish to disregard this recommendation, use `let _ = ...` to ignore the value",
style = "verbose",
applicability = "maybe-incorrect"
)]
Expand All @@ -2708,7 +2708,7 @@ pub(crate) enum UnusedDefSuggestion {
after_span: Span,
},
#[suggestion(
"use `let _unused = ...` to ignore the resulting value without dropping it immediately",
"if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately",
style = "verbose",
code = "let _unused = ",
applicability = "maybe-incorrect"
Expand All @@ -2718,7 +2718,7 @@ pub(crate) enum UnusedDefSuggestion {
span: Span,
},
#[multipart_suggestion(
"use `let _unused = ...` to ignore the resulting value without dropping it immediately",
"if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately",
style = "verbose",
applicability = "maybe-incorrect"
)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/attr-order-must-use.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LL | must_use();
|
= note: AAA
= note: `#[deny(unused_must_use)]` implied by `#[deny(unused)]`
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = must_use();
| +++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = MustUseDeprecated::new();
| +++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | f();
| ^^^
|
= note: requested on the command line with `-D unused-must-use`
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = f();
| +++++++
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lint/decorate-ice/decorate-force-warn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | f();
| ^^^
|
= note: requested on the command line with `--force-warn unused-must-use`
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = f();
| +++++++
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/lint/fn_must_use.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = need_to_use_this_value();
| +++++++
Expand All @@ -31,7 +31,7 @@ warning: unused return value of `MyStruct::need_to_use_this_method_value` that m
LL | m.need_to_use_this_method_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = m.need_to_use_this_method_value();
| +++++++
Expand All @@ -43,7 +43,7 @@ LL | m.is_even(); // trait method!
| ^^^^^^^^^^^
|
= note: no side effects
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = m.is_even(); // trait method!
| +++++++
Expand All @@ -54,7 +54,7 @@ warning: unused return value of `MyStruct::need_to_use_this_associated_function_
LL | MyStruct::need_to_use_this_associated_function_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = MyStruct::need_to_use_this_associated_function_value();
| +++++++
Expand All @@ -65,7 +65,7 @@ warning: unused return value of `std::cmp::PartialEq::eq` that must be used
LL | 2.eq(&3);
| ^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = 2.eq(&3);
| +++++++
Expand All @@ -76,7 +76,7 @@ warning: unused return value of `std::cmp::PartialEq::eq` that must be used
LL | m.eq(&n);
| ^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = m.eq(&n);
| +++++++
Expand All @@ -87,7 +87,7 @@ warning: unused comparison that must be used
LL | 2 == 3;
| ^^^^^^ the comparison produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = 2 == 3;
| +++++++
Expand All @@ -98,7 +98,7 @@ warning: unused comparison that must be used
LL | m == n;
| ^^^^^^ the comparison produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = m == n;
| +++++++
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/lint/unused-borrows.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: the lint level is defined here
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = &42;
| +++++++
Expand All @@ -20,7 +20,7 @@ error: unused borrow that must be used
LL | &mut foo(42);
| ^^^^^^^^^^^^ the borrow produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = &mut foo(42);
| +++++++
Expand All @@ -31,7 +31,7 @@ error: unused borrow that must be used
LL | &&42;
| ^^^^ the borrow produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = &&42;
| +++++++
Expand All @@ -42,7 +42,7 @@ error: unused borrow that must be used
LL | &&mut 42;
| ^^^^^^^^ the borrow produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = &&mut 42;
| +++++++
Expand All @@ -53,7 +53,7 @@ error: unused borrow that must be used
LL | &mut &42;
| ^^^^^^^^ the borrow produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = &mut &42;
| +++++++
Expand All @@ -64,7 +64,7 @@ error: unused borrow that must be used
LL | && foo(42);
| ^^^^^^^^^^ the borrow produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = && foo(42);
| +++++++
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/lint/unused/issue-103320-must-use-ops.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = x.add(4);
| +++++++
Expand All @@ -22,7 +22,7 @@ LL | x.sub(4);
| ^^^^^^^^
|
= note: this returns the result of the operation, without modifying the original
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = x.sub(4);
| +++++++
Expand All @@ -34,7 +34,7 @@ LL | x.mul(4);
| ^^^^^^^^
|
= note: this returns the result of the operation, without modifying the original
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = x.mul(4);
| +++++++
Expand All @@ -46,7 +46,7 @@ LL | x.div(4);
| ^^^^^^^^
|
= note: this returns the result of the operation, without modifying the original
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = x.div(4);
| +++++++
Expand All @@ -58,7 +58,7 @@ LL | x.rem(4);
| ^^^^^^^^
|
= note: this returns the result of the operation, without modifying the original
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = x.rem(4);
| +++++++
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lint/unused/issue-85913.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: the lint level is defined here
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = function() && return 1;
| +++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: the lint level is defined here
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = error();
| +++++++
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/lint/unused/must-use-block-expr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = foo();
| +++++++
Expand All @@ -20,7 +20,7 @@ warning: unused return value of `foo` that must be used
LL | foo()
| ^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = foo();
| +++++++ +
Expand All @@ -31,7 +31,7 @@ warning: unused arithmetic operation that must be used
LL | 1 + 2;
| ^^^^^ the arithmetic operation produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = 1 + 2;
| +++++++
Expand All @@ -42,7 +42,7 @@ warning: unused arithmetic operation that must be used
LL | 1 + 2
| ^^^^^ the arithmetic operation produces a value
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = 1 + 2;
| +++++++ +
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lint/unused/must-use-box-from-raw.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _unused = ...` to ignore the resulting value without dropping it immediately
help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately
|
LL | let _unused = Box::from_raw(ptr);
| +++++++++++++
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: the lint level is defined here
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _unused = ...` to ignore the resulting value without dropping it immediately
help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately
|
LL | let _unused = mutex.lock().unwrap();
| +++++++++++++
Expand All @@ -21,7 +21,7 @@ error: unused return value of `guard` that must be used
LL | guard();
| ^^^^^^^
|
help: use `let _unused = ...` to ignore the resulting value without dropping it immediately
help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately
|
LL | let _unused = guard();
| +++++++++++++
Expand All @@ -32,7 +32,7 @@ error: unused return value of `value` that must be used
LL | value();
| ^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = value();
| +++++++
Expand All @@ -43,7 +43,7 @@ error: unused return value of `vec_values` that must be used
LL | vec_values();
| ^^^^^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = vec_values();
| +++++++
Expand All @@ -54,7 +54,7 @@ error: unused return value of `box_value` that must be used
LL | box_value();
| ^^^^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = box_value();
| +++++++
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/lint/unused/must-use-macros.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = cmp!(a, b);
| +++++++
Expand All @@ -30,7 +30,7 @@ LL | $a == $b
LL | cmp!(1, 1);
| ---------- in this macro invocation
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = cmp!(1, 1);
| +++++++
Expand All @@ -41,7 +41,7 @@ warning: unused return value of `std::cmp::PartialEq::eq` that must be used
LL | cmp!(1, 1);
| ^^^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value
|
LL | let _ = cmp!(1, 1);
| +++++++
Expand Down
Loading
Loading