auto merge of #5070 : youknowone/rust/struct-match2, r=nikomatsakis
It is reversed that type of arm pattern and type of search pattern in error message.
This commit is contained in:
commit
5fc0eccdfa
5 changed files with 19 additions and 14 deletions
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
fn main() {
|
||||
match None {
|
||||
Err(_) => () //~ ERROR expected `core::result
|
||||
Err(_) => () //~ ERROR mismatched types: expected `core::option::Option<<V1>>` but found `core::result::Result<<V2>,<V3>>`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
// error-pattern: mismatched types
|
||||
|
||||
struct S { a: int }
|
||||
enum E { C(int) }
|
||||
|
||||
fn main() {
|
||||
match S { a: 1 } {
|
||||
C(_) => (),
|
||||
C(_) => (), //~ ERROR mismatched types: expected `S` but found `E`
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue