16 lines
270 B
Rust
16 lines
270 B
Rust
struct Foo {
|
|
a: isize,
|
|
b: isize,
|
|
}
|
|
|
|
type Bar = Box<Foo>;
|
|
|
|
fn want_foo(f: Foo) {}
|
|
fn have_bar(b: Bar) {
|
|
want_foo(b); //~ ERROR mismatched types
|
|
//~| expected type `Foo`
|
|
//~| found type `std::boxed::Box<Foo>`
|
|
}
|
|
|
|
fn main() {}
|