rust/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.rs
2023-05-30 13:04:25 +02:00

20 lines
492 B
Rust

#![feature(unboxed_closures)]
trait SomeTrait<'a> {
type Associated;
}
fn give_me_ice<T>() {
callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
//~^ ERROR the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied [E0277]
//~| ERROR the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied [E0277]
}
fn callee<T: Fn<(&'static (),)>>() {
println!("{}", std::any::type_name::<<T as FnOnce<(&'static (),)>>::Output>());
}
fn main() {
give_me_ice::<()>();
}