mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
14 lines
182 B
Rust
14 lines
182 B
Rust
|
struct Foo;
|
||
|
struct Bar;
|
||
|
|
||
|
impl From<&Foo> for Bar {
|
||
|
fn from(foo: &Foo) -> Bar {
|
||
|
Bar
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let foo = Foo;
|
||
|
let b: Bar = foo.into(); //~ ERROR E0277
|
||
|
}
|