]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/issue-23827.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / span / issue-23827.rs
1 // Regression test for #23827
2
3 #![feature(fn_traits, unboxed_closures)]
4
5 pub struct Prototype {
6     pub target: u32
7 }
8
9 trait Component {
10     fn apply(self, e: u32);
11 }
12
13 impl<C: Component> Fn<(C,)> for Prototype {
14     extern "rust-call" fn call(&self, (comp,): (C,)) -> Prototype {
15         comp.apply(self.target);
16         *self
17     }
18 }
19
20 impl<C: Component> FnMut<(C,)> for Prototype {
21     extern "rust-call" fn call_mut(&mut self, (comp,): (C,)) -> Prototype {
22         Fn::call(*&self, (comp,))
23     }
24 }
25
26 impl<C: Component> FnOnce<(C,)> for Prototype {
27     //~^ ERROR E0046
28     extern "rust-call" fn call_once(self, (comp,): (C,)) -> Prototype {
29         Fn::call(&self, (comp,))
30     }
31 }
32
33 fn main() {}