]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-51907.rs
Require Drop impls to have the same constness on its bounds as the bounds on the...
[rust.git] / src / test / ui / issues / issue-51907.rs
1 // run-pass
2 trait Foo {
3     extern "C" fn borrow(&self);
4     extern "C" fn take(self: Box<Self>);
5 }
6
7 struct Bar;
8 impl Foo for Bar {
9     #[allow(improper_ctypes_definitions)]
10     extern "C" fn borrow(&self) {}
11     #[allow(improper_ctypes_definitions)]
12     extern "C" 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 }