]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods/method-argument-inference-associated-type.rs
fn-trait-closure test now pass on new solver
[rust.git] / tests / ui / methods / method-argument-inference-associated-type.rs
1 // run-pass
2 pub struct ClientMap;
3 pub struct ClientMap2;
4
5 pub trait Service {
6     type Request;
7     fn call(&self, _req: Self::Request);
8 }
9
10 pub struct S<T>(#[allow(unused_tuple_struct_fields)] T);
11
12 impl Service for ClientMap {
13     type Request = S<Box<dyn Fn(i32)>>;
14     fn call(&self, _req: Self::Request) {}
15 }
16
17
18 impl Service for ClientMap2 {
19     type Request = (Box<dyn Fn(i32)>,);
20     fn call(&self, _req: Self::Request) {}
21 }
22
23
24 fn main() {
25     ClientMap.call(S { 0: Box::new(|_msgid| ()) });
26     ClientMap.call(S(Box::new(|_msgid| ())));
27     ClientMap2.call((Box::new(|_msgid| ()),));
28 }