]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
8faf50e0 XL |
2 | trait Foo { |
3 | extern fn borrow(&self); | |
4 | extern fn take(self: Box<Self>); | |
223e47cc | 5 | } |
8faf50e0 XL |
6 | |
7 | struct Bar; | |
8 | impl Foo for Bar { | |
9 | extern fn borrow(&self) {} | |
10 | extern fn take(self: Box<Self>) {} | |
11 | } | |
12 | ||
a7813a04 | 13 | fn main() { |
8faf50e0 XL |
14 | let foo: Box<dyn Foo> = Box::new(Bar); |
15 | foo.borrow(); | |
16 | foo.take() | |
54a0048b | 17 | } |