fix rebase

This commit is contained in:
Esteban Küber 2023-11-29 18:25:16 +00:00
parent 4e524386e9
commit cb0863475f
3 changed files with 24 additions and 2 deletions

View File

@ -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 => {}
}
}

View File

@ -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 => {}
}
}

View File

@ -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`.