a29023e9b2
Previously check always succeeded because struct type was derived from the matched expression, not the matched pattern.
12 lines
154 B
Rust
12 lines
154 B
Rust
// error-pattern: mismatched types
|
|
|
|
struct S { a: int }
|
|
enum E { C(int) }
|
|
|
|
fn main() {
|
|
match S { a: 1 } {
|
|
C(_) => (),
|
|
_ => ()
|
|
}
|
|
}
|