Skip to content

Commit e3c2f8f

Browse files
committed
slice_patterns: organize some tests
1 parent a1eadca commit e3c2f8f

6 files changed

+9
-9
lines changed

src/test/ui/match/match-vec-mismatch.stderr renamed to src/test/ui/array-slice-vec/slice-pat-type-mismatches.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error[E0425]: cannot find value `does_not_exist` in this scope
2-
--> $DIR/match-vec-mismatch.rs:26:11
2+
--> $DIR/slice-pat-type-mismatches.rs:26:11
33
|
44
LL | match does_not_exist {
55
| ^^^^^^^^^^^^^^ not found in this scope
66

77
error[E0529]: expected an array or slice, found `std::string::String`
8-
--> $DIR/match-vec-mismatch.rs:3:9
8+
--> $DIR/slice-pat-type-mismatches.rs:3:9
99
|
1010
LL | ['f', 'o', ..] => {}
1111
| ^^^^^^^^^^^^^^ pattern cannot match with input type `std::string::String`
1212

1313
error[E0527]: pattern requires 1 element but array has 3
14-
--> $DIR/match-vec-mismatch.rs:18:9
14+
--> $DIR/slice-pat-type-mismatches.rs:18:9
1515
|
1616
LL | [0] => {},
1717
| ^^^ expected 3 elements
1818

1919
error[E0528]: pattern requires at least 4 elements but array has 3
20-
--> $DIR/match-vec-mismatch.rs:23:9
20+
--> $DIR/slice-pat-type-mismatches.rs:23:9
2121
|
2222
LL | [0, 1, 2, 3, x @ ..] => {}
2323
| ^^^^^^^^^^^^^^^^^^^^ pattern cannot match array of 3 elements
2424

2525
error[E0282]: type annotations needed
26-
--> $DIR/match-vec-mismatch.rs:34:9
26+
--> $DIR/slice-pat-type-mismatches.rs:34:9
2727
|
2828
LL | [] => {}
2929
| ^^ cannot infer type

src/test/ui/parser/match-vec-invalid.stderr renamed to src/test/ui/array-slice-vec/subslice-only-once-semantic-restriction.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0416]: identifier `tail` is bound more than once in the same pattern
2-
--> $DIR/match-vec-invalid.rs:4:24
2+
--> $DIR/subslice-only-once-semantic-restriction.rs:4:24
33
|
44
LL | [1, tail @ .., tail @ ..] => {},
55
| ^^^^ used in a pattern more than once
66

77
error: `..` can only be used once per slice pattern
8-
--> $DIR/match-vec-invalid.rs:4:31
8+
--> $DIR/subslice-only-once-semantic-restriction.rs:4:31
99
|
1010
LL | [1, tail @ .., tail @ ..] => {},
1111
| -- ^^ can only be used once per slice pattern
1212
| |
1313
| previously used here
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/match-vec-invalid.rs:11:30
16+
--> $DIR/subslice-only-once-semantic-restriction.rs:11:30
1717
|
1818
LL | const RECOVERY_WITNESS: () = 0;
1919
| ^ expected `()`, found integer

src/test/ui/pattern/issue-53820-slice-pattern-large-array.rs renamed to src/test/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check-pass
22

3-
// This used to cause a stack overflow in the compiler.
3+
// This used to cause a stack overflow during exhaustiveness checking in the compiler.
44

55
fn main() {
66
const LARGE_SIZE: usize = 1024 * 1024;

0 commit comments

Comments
 (0)