rust/tests/ui/return/return-struct.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
306 B
Rust
Raw Normal View History

struct S;
enum Age {
Years(i64, i64)
}
fn foo() {
let mut age = 29;
Age::Years({age += 1; age}, 55)
//~^ ERROR mismatched types
}
fn bar() {
let mut age = 29;
Age::Years(age, 55)
//~^ ERROR mismatched types
}
fn baz() {
S
//~^ ERROR mismatched types
}
fn main() {}