Skip to content

Commit

Permalink
slice_patterns: organize some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jan 18, 2020
1 parent a1eadca commit e3c2f8f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
File renamed without changes.
@@ -1,29 +1,29 @@
error[E0425]: cannot find value `does_not_exist` in this scope
--> $DIR/match-vec-mismatch.rs:26:11
--> $DIR/slice-pat-type-mismatches.rs:26:11
|
LL | match does_not_exist {
| ^^^^^^^^^^^^^^ not found in this scope

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

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

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

error[E0282]: type annotations needed
--> $DIR/match-vec-mismatch.rs:34:9
--> $DIR/slice-pat-type-mismatches.rs:34:9
|
LL | [] => {}
| ^^ cannot infer type
Expand Down
File renamed without changes.
@@ -1,19 +1,19 @@
error[E0416]: identifier `tail` is bound more than once in the same pattern
--> $DIR/match-vec-invalid.rs:4:24
--> $DIR/subslice-only-once-semantic-restriction.rs:4:24
|
LL | [1, tail @ .., tail @ ..] => {},
| ^^^^ used in a pattern more than once

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

error[E0308]: mismatched types
--> $DIR/match-vec-invalid.rs:11:30
--> $DIR/subslice-only-once-semantic-restriction.rs:11:30
|
LL | const RECOVERY_WITNESS: () = 0;
| ^ expected `()`, found integer
Expand Down
@@ -1,6 +1,6 @@
// check-pass

// This used to cause a stack overflow in the compiler.
// This used to cause a stack overflow during exhaustiveness checking in the compiler.

fn main() {
const LARGE_SIZE: usize = 1024 * 1024;
Expand Down

0 comments on commit e3c2f8f

Please sign in to comment.