]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-51907.rs
Rollup merge of #66134 - estebank:unknown-formatting-trait, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-51907.rs
1 // run-pass
2 trait Foo {
3     extern fn borrow(&self);
4     extern fn take(self: Box<Self>);
5 }
6
7 struct Bar;
8 impl Foo for Bar {
9     #[allow(improper_ctypes)]
10     extern fn borrow(&self) {}
11     #[allow(improper_ctypes)]
12     extern fn take(self: Box<Self>) {}
13 }
14
15 fn main() {
16     let foo: Box<dyn Foo> = Box::new(Bar);
17     foo.borrow();
18     foo.take()
19 }