Change:
<ins> warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:13:19 | LL |     let _ = 1 as ((i32)) < 2; |                   ^   ^ | note: the lint level is defined here --> $DIR/unused-parens-issue-106413.rs:2:9 | LL | #![warn(unused_parens)] |         ^^^^^^^^^^^^^ help: remove these parentheses | LL -     let _ = 1 as ((i32)) < 2; LL +     let _ = 1 as (i32) < 2; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:14:18 | LL |     let _ = 1 as (i32); |                  ^   ^ | help: remove these parentheses | LL -     let _ = 1 as (i32); LL +     let _ = 1 as i32; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:15:18 | LL |     let _ = 1 as (i32) > 2; |                  ^   ^ | help: remove these parentheses | LL -     let _ = 1 as (i32) > 2; LL +     let _ = 1 as i32 > 2; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:16:21 | LL |     let _ = id(1 as (i32)) |                     ^   ^ | help: remove these parentheses | LL -     let _ = id(1 as (i32)) LL +     let _ = id(1 as i32) | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:18:21 | LL |     let _ = id(1 as (i32)) < 2; |                     ^   ^ | help: remove these parentheses | LL -     let _ = id(1 as (i32)) < 2; LL +     let _ = id(1 as i32) < 2; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:26:19 | LL |     let _ = 1 as ((i32)) << 2; |                   ^   ^ | help: remove these parentheses | LL -     let _ = 1 as ((i32)) << 2; LL +     let _ = 1 as (i32) << 2; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:27:18 | LL |     let _ = 1 as (i32); |                  ^   ^ | help: remove these parentheses | LL -     let _ = 1 as (i32); LL +     let _ = 1 as i32; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:28:18 | LL |     let _ = 1 as (i32) >> 2; |                  ^   ^ | help: remove these parentheses | LL -     let _ = 1 as (i32) >> 2; LL +     let _ = 1 as i32 >> 2; | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:29:21 | LL |     let _ = id(1 as (i32)) |                     ^   ^ | help: remove these parentheses | LL -     let _ = id(1 as (i32)) LL +     let _ = id(1 as i32) | warning: unnecessary parentheses around type --> $DIR/unused-parens-issue-106413.rs:31:21 | LL |     let _ = id(1 as (i32)) << 2; |                     ^   ^ | help: remove these parentheses | LL -     let _ = id(1 as (i32)) << 2; LL +     let _ = id(1 as i32) << 2; | warning: 10 warnings emitted </ins>

Discussion:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. If you cannot produce a minimal reproduction case (something that would work in isolation), please provide the steps or even link to a repository that causes the problematic output to occur. --Given the following code: The current output is: But with the suggestion applied the compiler displays an error with a different suggestion: <!-- The following is not always necessary. --Ideally the compiler should not output a warning and treat and as identical. <!-- If the problem is not self-explanatory, please provide a rationale for the change. --<!-- If dramatically different output is caused by small changes, consider also adding them here. If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. The output might also be different depending on the Edition. -- label D-incorrect A-suggestion-diagnostics <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
I think it's relate with and
It would be great if it could give since parenthesizing the expression instead avoids the potential "is that a tuple?" confusion of .
Duplicate of .