-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #115452 - matthiaskrgr:rollup-he30fhv, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #115411 (miri ABI check: fix handling of 1-ZST; don't accept sign differences) - #115424 (diagnostics: avoid wrong `unused_parens` on `x as (T) < y`) - #115425 (remove unnecessary heap allocation) - #115446 (fix version for abi_thiscall to 1.73.0, which was forgotten to change when stabilized and (later) moved to beta) - #115447 (Add comment so pub items are not removed) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
11 changed files
with
233 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// check-pass | ||
#![warn(unused_parens)] | ||
|
||
fn id<T>(t: T) -> T { t } | ||
|
||
fn main() { | ||
// This should not warn | ||
let _ = 1 as (i32) < 2; | ||
let _ = id(1 as (i32) < 2); | ||
let _ = id(1 as i32) | ||
as (i32) < 2; | ||
// These should warn | ||
let _ = 1 as ((i32)) < 2; //~WARN unnecessary parentheses | ||
let _ = 1 as (i32); //~WARN unnecessary parentheses | ||
let _ = 1 as (i32) > 2; //~WARN unnecessary parentheses | ||
let _ = id(1 as (i32)) //~WARN unnecessary parentheses | ||
as (i32) < 2; | ||
let _ = id(1 as (i32)) < 2; //~WARN unnecessary parentheses | ||
|
||
// This should not warn | ||
let _ = 1 as (i32) << 2; | ||
let _ = id(1 as (i32) << 2); | ||
let _ = id(1 as i32) | ||
as (i32) << 2; | ||
// These should warn | ||
let _ = 1 as ((i32)) << 2; //~WARN unnecessary parentheses | ||
let _ = 1 as (i32); //~WARN unnecessary parentheses | ||
let _ = 1 as (i32) >> 2; //~WARN unnecessary parentheses | ||
let _ = id(1 as (i32)) //~WARN unnecessary parentheses | ||
as (i32) << 2; | ||
let _ = id(1 as (i32)) << 2; //~WARN unnecessary parentheses | ||
} |
Oops, something went wrong.