2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2018-07-06 00:17:13 +03:00
|
|
|
trait Foo {
|
|
|
|
extern fn borrow(&self);
|
|
|
|
extern fn take(self: Box<Self>);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
impl Foo for Bar {
|
|
|
|
extern fn borrow(&self) {}
|
|
|
|
extern fn take(self: Box<Self>) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let foo: Box<dyn Foo> = Box::new(Bar);
|
|
|
|
foo.borrow();
|
|
|
|
foo.take()
|
|
|
|
}
|