summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2-ok.rs
blob: 1422dda276b9b0a78eba0956d6ac92543f909b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Make sure that we're handling bound lifetimes correctly when validating trait
// bounds.
// run-pass

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 = fn(&i32) -> &'x i32>>();
}