rust/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs
2023-01-11 09:32:08 +00:00

28 lines
384 B
Rust

// check-pass
pub struct Struct {}
pub trait Trait<'a> {
type Assoc;
fn method() -> Self::Assoc;
}
impl<'a> Trait<'a> for Struct {
type Assoc = ();
fn method() -> Self::Assoc {}
}
pub fn function<F, T>(f: F)
where
F: for<'a> FnOnce(<T as Trait<'a>>::Assoc),
T: for<'b> Trait<'b>,
{
f(T::method());
}
fn main() {
function::<_, Struct>(|_| {});
}