about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec
diff options
context:
space:
mode:
authorb-naber <b_naber@gmx.de>2023-07-10 22:11:21 +0000
committerb-naber <b_naber@gmx.de>2023-07-17 22:06:32 +0000
commit65f92a52bfee3f2d989695b80c36906404fffeca (patch)
tree10cd78ae0ba25f4613c38c1f310581a92bde17df /tests/ui/array-slice-vec
parent1c217b6d8a55865535d06752a65ba2ae24f7b349 (diff)
downloadrust-65f92a52bfee3f2d989695b80c36906404fffeca.tar.gz
rust-65f92a52bfee3f2d989695b80c36906404fffeca.zip
address review
Diffstat (limited to 'tests/ui/array-slice-vec')
-rw-r--r--tests/ui/array-slice-vec/slice-pat-type-mismatches.rs5
-rw-r--r--tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr16
2 files changed, 10 insertions, 11 deletions
diff --git a/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs b/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs
index 310c49701ed..03a1876fdc5 100644
--- a/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs
+++ b/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs
@@ -30,9 +30,8 @@ fn main() {
 }
 
 fn another_fn_to_avoid_suppression() {
-    match Default
-    //~^ ERROR expected value, found trait
-    {
+    match Default::default() {
         [] => {}
+        //~^ ERROR type annotations needed
     };
 }
diff --git a/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr b/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr
index 6218bffd503..d1d042c4776 100644
--- a/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr
+++ b/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr
@@ -4,12 +4,6 @@ error[E0425]: cannot find value `does_not_exist` in this scope
 LL |     match does_not_exist {
    |           ^^^^^^^^^^^^^^ not found in this scope
 
-error[E0423]: expected value, found trait `Default`
-  --> $DIR/slice-pat-type-mismatches.rs:33:11
-   |
-LL |     match Default
-   |           ^^^^^^^ not a value
-
 error[E0529]: expected an array or slice, found `String`
   --> $DIR/slice-pat-type-mismatches.rs:3:9
    |
@@ -28,7 +22,13 @@ error[E0528]: pattern requires at least 4 elements but array has 3
 LL |         [0, 1, 2, 3, x @ ..] => {}
    |         ^^^^^^^^^^^^^^^^^^^^ pattern cannot match array of 3 elements
 
+error[E0282]: type annotations needed
+  --> $DIR/slice-pat-type-mismatches.rs:34:9
+   |
+LL |         [] => {}
+   |         ^^ cannot infer type
+
 error: aborting due to 5 previous errors
 
-Some errors have detailed explanations: E0423, E0425, E0527, E0528, E0529.
-For more information about an error, try `rustc --explain E0423`.
+Some errors have detailed explanations: E0282, E0425, E0527, E0528, E0529.
+For more information about an error, try `rustc --explain E0282`.