2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2017-08-21 13:44:42 +00:00
|
|
|
pub struct ClientMap;
|
|
|
|
pub struct ClientMap2;
|
|
|
|
|
|
|
|
pub trait Service {
|
|
|
|
type Request;
|
|
|
|
fn call(&self, _req: Self::Request);
|
|
|
|
}
|
|
|
|
|
2023-12-27 22:11:58 +00:00
|
|
|
pub struct S<T>(#[allow(dead_code)] T);
|
2017-08-21 13:44:42 +00:00
|
|
|
|
|
|
|
impl Service for ClientMap {
|
2019-05-28 18:47:21 +00:00
|
|
|
type Request = S<Box<dyn Fn(i32)>>;
|
2017-08-21 13:44:42 +00:00
|
|
|
fn call(&self, _req: Self::Request) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl Service for ClientMap2 {
|
2019-05-28 18:47:21 +00:00
|
|
|
type Request = (Box<dyn Fn(i32)>,);
|
2017-08-21 13:44:42 +00:00
|
|
|
fn call(&self, _req: Self::Request) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
ClientMap.call(S { 0: Box::new(|_msgid| ()) });
|
|
|
|
ClientMap.call(S(Box::new(|_msgid| ())));
|
|
|
|
ClientMap2.call((Box::new(|_msgid| ()),));
|
|
|
|
}
|