]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14958.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-14958.rs
1 // run-pass
2 // pretty-expanded FIXME #23616
3
4 #![feature(fn_traits, unboxed_closures)]
5
6 trait Foo { fn dummy(&self) { }}
7
8 struct Bar;
9
10 impl<'a> std::ops::Fn<(&'a (dyn Foo+'a),)> for Bar {
11     extern "rust-call" fn call(&self, _: (&'a dyn Foo,)) {}
12 }
13
14 impl<'a> std::ops::FnMut<(&'a (dyn Foo+'a),)> for Bar {
15     extern "rust-call" fn call_mut(&mut self, a: (&'a dyn Foo,)) { self.call(a) }
16 }
17
18 impl<'a> std::ops::FnOnce<(&'a (dyn Foo+'a),)> for Bar {
19     type Output = ();
20     extern "rust-call" fn call_once(self, a: (&'a dyn Foo,)) { self.call(a) }
21 }
22
23 struct Baz;
24
25 impl Foo for Baz {}
26
27 fn main() {
28     let bar = Bar;
29     let baz = &Baz;
30     bar(baz);
31 }