]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2-ok.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / traits / associated_type_bound / check-trait-object-bounds-2-ok.rs
CommitLineData
29967ef6
XL
1// Make sure that we're handling bound lifetimes correctly when validating trait
2// bounds.
3// run-pass
4
5trait X<'a> {
6 type F: FnOnce(&i32) -> &'a i32;
7}
8
9fn f<T: for<'r> X<'r> + ?Sized>() {
10 None::<T::F>.map(|f| f(&0));
11}
12
13fn main() {
14 f::<dyn for<'x> X<'x, F = fn(&i32) -> &'x i32>>();
15}