about summary refs log tree commit diff
path: root/tests/ui/destructuring-assignment
diff options
context:
space:
mode:
authorb-naber <b_naber@gmx.de>2023-07-17 21:58:37 +0000
committerb-naber <b_naber@gmx.de>2023-07-17 22:06:32 +0000
commite1e755311a6ae8a3d15dff80851d00a8b2881d82 (patch)
tree7645a0d85e12ff2b759c8209e1c845f4d680ef02 /tests/ui/destructuring-assignment
parent96af415476968d91847dde81c8ac907823b0def0 (diff)
downloadrust-e1e755311a6ae8a3d15dff80851d00a8b2881d82.tar.gz
rust-e1e755311a6ae8a3d15dff80851d00a8b2881d82.zip
add more tests
Diffstat (limited to 'tests/ui/destructuring-assignment')
-rw-r--r--tests/ui/destructuring-assignment/slice_destructure_fail.rs2
-rw-r--r--tests/ui/destructuring-assignment/slice_destructure_fail.stderr25
2 files changed, 3 insertions, 24 deletions
diff --git a/tests/ui/destructuring-assignment/slice_destructure_fail.rs b/tests/ui/destructuring-assignment/slice_destructure_fail.rs
index e36557940ee..e5bb50030b9 100644
--- a/tests/ui/destructuring-assignment/slice_destructure_fail.rs
+++ b/tests/ui/destructuring-assignment/slice_destructure_fail.rs
@@ -3,8 +3,6 @@ fn main() {
     [a, .., b, ..] = [0, 1]; //~ ERROR `..` can only be used once per slice pattern
     [a, a, b] = [1, 2];
     //~^ ERROR pattern requires 3 elements but array has 2
-    //~| ERROR mismatched types
     [_] = [1, 2];
     //~^ ERROR pattern requires 1 element but array has 2
-    //~| ERROR mismatched types
 }
diff --git a/tests/ui/destructuring-assignment/slice_destructure_fail.stderr b/tests/ui/destructuring-assignment/slice_destructure_fail.stderr
index e42b9695d4d..acf44ceb184 100644
--- a/tests/ui/destructuring-assignment/slice_destructure_fail.stderr
+++ b/tests/ui/destructuring-assignment/slice_destructure_fail.stderr
@@ -6,37 +6,18 @@ LL |     [a, .., b, ..] = [0, 1];
    |         |
    |         previously used here
 
-error[E0308]: mismatched types
-  --> $DIR/slice_destructure_fail.rs:4:5
-   |
-LL |     [a, a, b] = [1, 2];
-   |     ^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
-   |
-   = note: expected array `[{integer}; 2]`
-              found array `[_; 3]`
-
 error[E0527]: pattern requires 3 elements but array has 2
   --> $DIR/slice_destructure_fail.rs:4:5
    |
 LL |     [a, a, b] = [1, 2];
    |     ^^^^^^^^^ expected 2 elements
 
-error[E0308]: mismatched types
-  --> $DIR/slice_destructure_fail.rs:7:5
-   |
-LL |     [_] = [1, 2];
-   |     ^^^ expected an array with a fixed size of 2 elements, found one with 1 element
-   |
-   = note: expected array `[{integer}; 2]`
-              found array `[_; 1]`
-
 error[E0527]: pattern requires 1 element but array has 2
-  --> $DIR/slice_destructure_fail.rs:7:5
+  --> $DIR/slice_destructure_fail.rs:6:5
    |
 LL |     [_] = [1, 2];
    |     ^^^ expected 2 elements
 
-error: aborting due to 5 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0308, E0527.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0527`.