mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
slice_patterns: organize some tests
This commit is contained in:
parent
a1eadca88f
commit
e3c2f8fc57
@ -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
|
@ -1,11 +1,11 @@
|
||||
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
|
||||
@ -13,7 +13,7 @@ LL | [1, tail @ .., tail @ ..] => {},
|
||||
| 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
|
@ -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;
|
Loading…
Reference in New Issue
Block a user