Skip to content

Commit afbba42

Browse files
committed
fix rebase
1 parent b804283 commit afbba42

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

tests/ui/pattern/pattern-bad-ref-box-order.fixed

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
fn foo(f: Option<Box<i32>>) {
77
match f {
8-
Some(box ref _i) => {},
8+
Some(box ref, _i) => {},
99
//~^ ERROR switch the order of `ref` and `box`
10+
//~| ERROR expected one of `)`, `,`, or `|`, found `_i`
11+
//~| ERROR this pattern has 2 fields, but the corresponding tuple variant has 1 field
1012
None => {}
1113
}
1214
}

tests/ui/pattern/pattern-bad-ref-box-order.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ fn foo(f: Option<Box<i32>>) {
77
match f {
88
Some(ref box _i) => {},
99
//~^ ERROR switch the order of `ref` and `box`
10+
//~| ERROR expected one of `)`, `,`, or `|`, found `_i`
11+
//~| ERROR this pattern has 2 fields, but the corresponding tuple variant has 1 field
1012
None => {}
1113
}
1214
}

tests/ui/pattern/pattern-bad-ref-box-order.stderr

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,23 @@ error: switch the order of `ref` and `box`
44
LL | Some(ref box _i) => {},
55
| ^^^^^^^ help: swap them: `box ref`
66

7-
error: aborting due to 1 previous error
7+
error: expected one of `)`, `,`, or `|`, found `_i`
8+
--> $DIR/pattern-bad-ref-box-order.rs:8:22
9+
|
10+
LL | Some(ref box _i) => {},
11+
| -^^ expected one of `)`, `,`, or `|`
12+
| |
13+
| help: missing `,`
14+
15+
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
16+
--> $DIR/pattern-bad-ref-box-order.rs:8:22
17+
|
18+
LL | Some(ref box _i) => {},
19+
| ^^ expected 1 field, found 2
20+
--> $SRC_DIR/core/src/option.rs:LL:COL
21+
|
22+
= note: tuple variant has 1 field
23+
24+
error: aborting due to 3 previous errors
825

26+
For more information about this error, try `rustc --explain E0023`.

0 commit comments

Comments
 (0)