about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-11-29 18:25:16 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-11-29 18:47:32 +0000
commitcb0863475f53854114a1ebcebc02d9cd82d3dd95 (patch)
tree20eb32a192c41086d62327e335d9de03e0a32196
parent4e524386e9afb232783a3bcaecd1d39620d5fb5f (diff)
downloadrust-cb0863475f53854114a1ebcebc02d9cd82d3dd95.tar.gz
rust-cb0863475f53854114a1ebcebc02d9cd82d3dd95.zip
fix rebase
-rw-r--r--tests/ui/pattern/pattern-bad-ref-box-order.fixed4
-rw-r--r--tests/ui/pattern/pattern-bad-ref-box-order.rs2
-rw-r--r--tests/ui/pattern/pattern-bad-ref-box-order.stderr20
3 files changed, 24 insertions, 2 deletions
diff --git a/tests/ui/pattern/pattern-bad-ref-box-order.fixed b/tests/ui/pattern/pattern-bad-ref-box-order.fixed
index 8825744a08b..e99ab449a6c 100644
--- a/tests/ui/pattern/pattern-bad-ref-box-order.fixed
+++ b/tests/ui/pattern/pattern-bad-ref-box-order.fixed
@@ -5,8 +5,10 @@
 
 fn foo(f: Option<Box<i32>>) {
     match f {
-        Some(box ref _i) => {},
+        Some(box ref, _i) => {},
         //~^ ERROR switch the order of `ref` and `box`
+        //~| ERROR expected one of `)`, `,`, or `|`, found `_i`
+        //~| ERROR this pattern has 2 fields, but the corresponding tuple variant has 1 field
         None => {}
     }
 }
diff --git a/tests/ui/pattern/pattern-bad-ref-box-order.rs b/tests/ui/pattern/pattern-bad-ref-box-order.rs
index f3fcf0ceacf..3632bb438de 100644
--- a/tests/ui/pattern/pattern-bad-ref-box-order.rs
+++ b/tests/ui/pattern/pattern-bad-ref-box-order.rs
@@ -7,6 +7,8 @@ fn foo(f: Option<Box<i32>>) {
     match f {
         Some(ref box _i) => {},
         //~^ ERROR switch the order of `ref` and `box`
+        //~| ERROR expected one of `)`, `,`, or `|`, found `_i`
+        //~| ERROR this pattern has 2 fields, but the corresponding tuple variant has 1 field
         None => {}
     }
 }
diff --git a/tests/ui/pattern/pattern-bad-ref-box-order.stderr b/tests/ui/pattern/pattern-bad-ref-box-order.stderr
index a49f05c1028..0d3ab639446 100644
--- a/tests/ui/pattern/pattern-bad-ref-box-order.stderr
+++ b/tests/ui/pattern/pattern-bad-ref-box-order.stderr
@@ -4,5 +4,23 @@ error: switch the order of `ref` and `box`
 LL |         Some(ref box _i) => {},
    |              ^^^^^^^ help: swap them: `box ref`
 
-error: aborting due to 1 previous error
+error: expected one of `)`, `,`, or `|`, found `_i`
+  --> $DIR/pattern-bad-ref-box-order.rs:8:22
+   |
+LL |         Some(ref box _i) => {},
+   |                     -^^ expected one of `)`, `,`, or `|`
+   |                     |
+   |                     help: missing `,`
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
+  --> $DIR/pattern-bad-ref-box-order.rs:8:22
+   |
+LL |         Some(ref box _i) => {},
+   |                      ^^ expected 1 field, found 2
+  --> $SRC_DIR/core/src/option.rs:LL:COL
+   |
+   = note: tuple variant has 1 field
+
+error: aborting due to 3 previous errors
 
+For more information about this error, try `rustc --explain E0023`.