-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #79243 - Nadrieril:consolidate-tests, r=varkor
Consolidate exhaustiveness-related tests I hunted for tests that only exercised the match exhaustiveness algorithm and regrouped them. I also improved integer-range tests since I had found them lacking while hacking around. The interest is mainly so that one can pass `--test-args patterns` and catch most relevant tests. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
- Loading branch information
Showing
71 changed files
with
908 additions
and
665 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
21 changes: 13 additions & 8 deletions
21
src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
#![feature(exclusive_range_pattern)] | ||
|
||
use std::usize::MAX; | ||
use std::{isize, usize}; | ||
|
||
fn main() { | ||
match 0usize { //~ERROR non-exhaustive patterns: `_` not covered | ||
0..=MAX => {} | ||
match 0usize { | ||
//~^ ERROR non-exhaustive patterns: `_` not covered | ||
//~| NOTE pattern `_` not covered | ||
//~| NOTE the matched value is of type `usize` | ||
//~| NOTE `usize` does not have a fixed maximum value | ||
0..=usize::MAX => {} | ||
} | ||
|
||
match 0isize { //~ERROR non-exhaustive patterns: `_` not covered | ||
1..=20 => {} | ||
-5..3 => {} | ||
match 0isize { | ||
//~^ ERROR non-exhaustive patterns: `_` not covered | ||
//~| NOTE pattern `_` not covered | ||
//~| NOTE the matched value is of type `isize` | ||
//~| NOTE `isize` does not have a fixed maximum value | ||
isize::MIN..=isize::MAX => {} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
172 changes: 0 additions & 172 deletions
172
src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs
This file was deleted.
Oops, something went wrong.
146 changes: 0 additions & 146 deletions
146
src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.