diff --git a/compiler/rustc_lint/src/diagnostics.rs b/compiler/rustc_lint/src/diagnostics.rs index 3887211465b32..3ed2c3bb1b6c8 100644 --- a/compiler/rustc_lint/src/diagnostics.rs +++ b/compiler/rustc_lint/src/diagnostics.rs @@ -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" @@ -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" )] @@ -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" @@ -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" )] @@ -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" @@ -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" )] diff --git a/tests/ui/attributes/attr-order-must-use.stderr b/tests/ui/attributes/attr-order-must-use.stderr index 18b5811623017..79c040cebe9c3 100644 --- a/tests/ui/attributes/attr-order-must-use.stderr +++ b/tests/ui/attributes/attr-order-must-use.stderr @@ -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(); | +++++++ diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr b/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr index 123ce71727f67..40067e99bd8b7 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr @@ -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(); | +++++++ diff --git a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr index fde81de6136ed..7991079a90e04 100644 --- a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr +++ b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr @@ -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(); | +++++++ diff --git a/tests/ui/lint/decorate-ice/decorate-force-warn.stderr b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr index 5e6b74d414b27..7376064d8a29e 100644 --- a/tests/ui/lint/decorate-ice/decorate-force-warn.stderr +++ b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr @@ -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(); | +++++++ diff --git a/tests/ui/lint/fn_must_use.stderr b/tests/ui/lint/fn_must_use.stderr index 1277a6283c645..c2e330725c821 100644 --- a/tests/ui/lint/fn_must_use.stderr +++ b/tests/ui/lint/fn_must_use.stderr @@ -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(); | +++++++ @@ -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(); | +++++++ @@ -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! | +++++++ @@ -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(); | +++++++ @@ -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); | +++++++ @@ -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); | +++++++ @@ -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; | +++++++ @@ -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; | +++++++ diff --git a/tests/ui/lint/unused-borrows.stderr b/tests/ui/lint/unused-borrows.stderr index d8dd2b5fddf94..7157ac555405a 100644 --- a/tests/ui/lint/unused-borrows.stderr +++ b/tests/ui/lint/unused-borrows.stderr @@ -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; | +++++++ @@ -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); | +++++++ @@ -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; | +++++++ @@ -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; | +++++++ @@ -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; | +++++++ @@ -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); | +++++++ diff --git a/tests/ui/lint/unused/issue-103320-must-use-ops.stderr b/tests/ui/lint/unused/issue-103320-must-use-ops.stderr index 0f32757ed20fd..eae3639f48d66 100644 --- a/tests/ui/lint/unused/issue-103320-must-use-ops.stderr +++ b/tests/ui/lint/unused/issue-103320-must-use-ops.stderr @@ -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); | +++++++ @@ -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); | +++++++ @@ -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); | +++++++ @@ -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); | +++++++ @@ -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); | +++++++ diff --git a/tests/ui/lint/unused/issue-85913.stderr b/tests/ui/lint/unused/issue-85913.stderr index b69ac3d97fd25..84f1d31aa7469 100644 --- a/tests/ui/lint/unused/issue-85913.stderr +++ b/tests/ui/lint/unused/issue-85913.stderr @@ -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; | +++++++ diff --git a/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr b/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr index 12cedf58974b7..dada2909d5bec 100644 --- a/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr +++ b/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr @@ -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(); | +++++++ diff --git a/tests/ui/lint/unused/must-use-block-expr.stderr b/tests/ui/lint/unused/must-use-block-expr.stderr index d821beb1d92e7..f432ce5337180 100644 --- a/tests/ui/lint/unused/must-use-block-expr.stderr +++ b/tests/ui/lint/unused/must-use-block-expr.stderr @@ -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(); | +++++++ @@ -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(); | +++++++ + @@ -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; | +++++++ @@ -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; | +++++++ + diff --git a/tests/ui/lint/unused/must-use-box-from-raw.stderr b/tests/ui/lint/unused/must-use-box-from-raw.stderr index 7eab99e97cd82..0a1d3dba598fd 100644 --- a/tests/ui/lint/unused/must-use-box-from-raw.stderr +++ b/tests/ui/lint/unused/must-use-box-from-raw.stderr @@ -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); | +++++++++++++ diff --git a/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr b/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr index 8fa5c693f2561..ff5a6413db10e 100644 --- a/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr +++ b/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr @@ -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(); | +++++++++++++ @@ -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(); | +++++++++++++ @@ -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(); | +++++++ @@ -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(); | +++++++ @@ -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(); | +++++++ diff --git a/tests/ui/lint/unused/must-use-macros.stderr b/tests/ui/lint/unused/must-use-macros.stderr index c5e9de20595b1..52251068901ff 100644 --- a/tests/ui/lint/unused/must-use-macros.stderr +++ b/tests/ui/lint/unused/must-use-macros.stderr @@ -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); | +++++++ @@ -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); | +++++++ @@ -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); | +++++++ diff --git a/tests/ui/lint/unused/must-use-ops.stderr b/tests/ui/lint/unused/must-use-ops.stderr index 41594f47a1398..14cdeabec4614 100644 --- a/tests/ui/lint/unused/must-use-ops.stderr +++ b/tests/ui/lint/unused/must-use-ops.stderr @@ -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 _ = val == 1; | +++++++ @@ -20,7 +20,7 @@ warning: unused comparison that must be used LL | val < 1; | ^^^^^^^ 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 _ = val < 1; | +++++++ @@ -31,7 +31,7 @@ warning: unused comparison that must be used LL | val <= 1; | ^^^^^^^^ 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 _ = val <= 1; | +++++++ @@ -42,7 +42,7 @@ warning: unused comparison that must be used LL | val != 1; | ^^^^^^^^ 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 _ = val != 1; | +++++++ @@ -53,7 +53,7 @@ warning: unused comparison that must be used LL | val >= 1; | ^^^^^^^^ 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 _ = val >= 1; | +++++++ @@ -64,7 +64,7 @@ warning: unused comparison that must be used LL | val > 1; | ^^^^^^^ 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 _ = val > 1; | +++++++ @@ -75,7 +75,7 @@ warning: unused arithmetic operation that must be used LL | val + 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 _ = val + 2; | +++++++ @@ -86,7 +86,7 @@ warning: unused arithmetic operation that must be used LL | val - 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 _ = val - 2; | +++++++ @@ -97,7 +97,7 @@ warning: unused arithmetic operation that must be used LL | val / 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 _ = val / 2; | +++++++ @@ -108,7 +108,7 @@ warning: unused arithmetic operation that must be used LL | val * 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 _ = val * 2; | +++++++ @@ -119,7 +119,7 @@ warning: unused arithmetic operation that must be used LL | val % 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 _ = val % 2; | +++++++ @@ -130,7 +130,7 @@ warning: unused logical operation that must be used LL | true && true; | ^^^^^^^^^^^^ the logical 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 _ = true && true; | +++++++ @@ -141,7 +141,7 @@ warning: unused logical operation that must be used LL | false || true; | ^^^^^^^^^^^^^ the logical 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 _ = false || true; | +++++++ @@ -152,7 +152,7 @@ warning: unused bitwise operation that must be used LL | 5 ^ val; | ^^^^^^^ the bitwise 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 _ = 5 ^ val; | +++++++ @@ -163,7 +163,7 @@ warning: unused bitwise operation that must be used LL | 5 & val; | ^^^^^^^ the bitwise 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 _ = 5 & val; | +++++++ @@ -174,7 +174,7 @@ warning: unused bitwise operation that must be used LL | 5 | val; | ^^^^^^^ the bitwise 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 _ = 5 | val; | +++++++ @@ -185,7 +185,7 @@ warning: unused bitwise operation that must be used LL | 5 << val; | ^^^^^^^^ the bitwise 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 _ = 5 << val; | +++++++ @@ -196,7 +196,7 @@ warning: unused bitwise operation that must be used LL | 5 >> val; | ^^^^^^^^ the bitwise 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 _ = 5 >> val; | +++++++ @@ -207,7 +207,7 @@ warning: unused unary operation that must be used LL | !val; | ^^^^ the unary 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 _ = !val; | +++++++ @@ -218,7 +218,7 @@ warning: unused unary operation that must be used LL | -val; | ^^^^ the unary 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 _ = -val; | +++++++ @@ -229,7 +229,7 @@ warning: unused unary operation that must be used LL | *val_pointer; | ^^^^^^^^^^^^ the unary 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 _ = *val_pointer; | +++++++ diff --git a/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr b/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr index 13c51a588fb03..75c08baededf8 100644 --- a/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr +++ b/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr @@ -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 _ = result_unit_unit(); | +++++++ @@ -28,7 +28,7 @@ LL | result_unit_myuninhabited_nonexhaustive(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = result_unit_myuninhabited_nonexhaustive(); | +++++++ @@ -40,7 +40,7 @@ LL | result_unit_assoctype(S2); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = result_unit_assoctype(S2); | +++++++ @@ -52,7 +52,7 @@ LL | S2.method_use_assoc_type(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = S2.method_use_assoc_type(); | +++++++ @@ -63,7 +63,7 @@ error: unused `ControlFlow` that must be used LL | controlflow_unit(); | ^^^^^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = controlflow_unit(); | +++++++ @@ -75,7 +75,7 @@ LL | self.generate(); | ^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -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 = self.generate(); | +++++++++++++ diff --git a/tests/ui/lint/unused/must_use-unit.stderr b/tests/ui/lint/unused/must_use-unit.stderr index b6e365a468173..c5328c1f3d3b4 100644 --- a/tests/ui/lint/unused/must_use-unit.stderr +++ b/tests/ui/lint/unused/must_use-unit.stderr @@ -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 _ = foo(); | +++++++ @@ -20,7 +20,7 @@ error: unused return value of `bar` that must be used LL | bar(); | ^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = bar(); | +++++++ diff --git a/tests/ui/lint/unused/unused-async.stderr b/tests/ui/lint/unused/unused-async.stderr index 43bc73d2758c1..08c949072012c 100644 --- a/tests/ui/lint/unused/unused-async.stderr +++ b/tests/ui/lint/unused/unused-async.stderr @@ -17,7 +17,7 @@ error: unused return value of `foo` that must be used LL | foo(); | ^^^^^ | -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 = foo(); | +++++++++++++ @@ -28,7 +28,7 @@ error: unused output of future returned by `foo` that must be used LL | foo().await; | ^^^^^^^^^^^ | -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().await; | +++++++ @@ -47,7 +47,7 @@ error: unused return value of `bar` that must be used LL | bar(); | ^^^^^ | -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 = bar(); | +++++++++++++ diff --git a/tests/ui/lint/unused/unused-result.stderr b/tests/ui/lint/unused/unused-result.stderr index b584733ba1cb4..8d369f3ad556e 100644 --- a/tests/ui/lint/unused/unused-result.stderr +++ b/tests/ui/lint/unused/unused-result.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(unused_results, 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::(); | +++++++ @@ -21,7 +21,7 @@ LL | foo::(); | ^^^^^^^^^^^^^^^^^^^ | = note: some message -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::(); | +++++++ @@ -44,7 +44,7 @@ error: unused `MustUse` 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::(); | +++++++ @@ -56,7 +56,7 @@ LL | foo::(); | ^^^^^^^^^^^^^^^^^^^ | = note: some message -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::(); | +++++++ diff --git a/tests/ui/lint/unused/unused_attributes-must_use.stderr b/tests/ui/lint/unused/unused_attributes-must_use.stderr index 18340f963801e..0730408d6e658 100644 --- a/tests/ui/lint/unused/unused_attributes-must_use.stderr +++ b/tests/ui/lint/unused/unused_attributes-must_use.stderr @@ -213,7 +213,7 @@ note: the lint level is defined here | LL | #![deny(unused_attributes, 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; | +++++++ @@ -224,7 +224,7 @@ error: unused `Y` that must be used LL | Y::Z; | ^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = Y::Z; | +++++++ @@ -235,7 +235,7 @@ error: unused `U` that must be used LL | U { unit: () }; | ^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = U { unit: () }; | +++++++ @@ -246,7 +246,7 @@ error: unused return value of `U::method` that must be used LL | U::method(); | ^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = U::method(); | +++++++ @@ -257,7 +257,7 @@ error: 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(); | +++++++ @@ -268,7 +268,7 @@ error: unused return value of `foreign_foo` that must be used LL | foreign_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 _ = foreign_foo(); | +++++++ @@ -279,7 +279,7 @@ error: unused return value of `Use::get_four` that must be used LL | ().get_four(); | ^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = ().get_four(); | +++++++ diff --git a/tests/ui/macros/must-use-in-macro-55516.stderr b/tests/ui/macros/must-use-in-macro-55516.stderr index b93d40d7e5a81..90d3c62e0d915 100644 --- a/tests/ui/macros/must-use-in-macro-55516.stderr +++ b/tests/ui/macros/must-use-in-macro-55516.stderr @@ -7,7 +7,7 @@ LL | write!(&mut example, "{}", 42); = note: this `Result` may be an `Err` variant, which should be handled = note: `-W unused-must-use` implied by `-W unused` = help: to override `-W unused` add `#[allow(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 _ = write!(&mut example, "{}", 42); | +++++++