2021-09-04 07:00:10 -05:00
|
|
|
#![feature(unboxed_closures)]
|
|
|
|
|
|
|
|
trait SomeTrait<'a> {
|
|
|
|
type Associated;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn give_me_ice<T>() {
|
|
|
|
callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
|
2022-09-21 10:57:30 -05:00
|
|
|
//~^ ERROR the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied [E0277]
|
2022-09-17 13:35:47 -05:00
|
|
|
//~| ERROR the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied [E0277]
|
2021-09-04 07:00:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn callee<T: Fn<(&'static (),)>>() {
|
|
|
|
println!("{}", std::any::type_name::<<T as FnOnce<(&'static (),)>>::Output>());
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
give_me_ice::<()>();
|
|
|
|
}
|