rust/src/test/ui/terr-in-field.rs
2018-12-25 21:08:33 -07:00

20 lines
339 B
Rust

struct Foo {
a: isize,
b: isize,
}
struct Bar {
a: isize,
b: usize,
}
fn want_foo(f: Foo) {}
fn have_bar(b: Bar) {
want_foo(b); //~ ERROR mismatched types
//~| expected type `Foo`
//~| found type `Bar`
//~| expected struct `Foo`, found struct `Bar`
}
fn main() {}