blob: 1359eb6cb87a48d80b6c7fa75f24f93083a8298c [file] [log] [blame]
// Check that we validate associated type bounds for trait objects when they
// have bound lifetimes
trait X<'a> {
type F: FnOnce(&i32) -> &'a i32;
}
fn f<T: for<'r> X<'r> + ?Sized>() {
None::<T::F>.map(|f| f(&0));
}
fn main() {
f::<dyn for<'x> X<'x, F = i32>>();
//~^ expected a `FnOnce(&i32)` closure, found `i32`
}