1 2 3 4 5 6 7 8 9 10 11 12
// check-pass #![feature(trait_alias)] struct MyStruct {} trait MyFn = Fn(&MyStruct); fn foo(_: impl MyFn) {} fn main() { foo(|_| {}); }