blob: 9378f4357134b001e29611bac30e31f8f5354840 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// run-pass
trait Foo {
extern "C" fn borrow(&self);
extern "C" fn take(self: Box<Self>);
}
struct Bar;
impl Foo for Bar {
#[allow(improper_ctypes_definitions)]
extern "C" fn borrow(&self) {}
#[allow(improper_ctypes_definitions)]
extern "C" fn take(self: Box<Self>) {}
}
fn main() {
let foo: Box<dyn Foo> = Box::new(Bar);
foo.borrow();
foo.take()
}
|