Skip to content

Commit 296010a

Browse files
committed
Add test for issue 28994
1 parent 04b2f91 commit 296010a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ check-pass
2+
3+
trait LifetimeToType<'a> {
4+
type Out;
5+
}
6+
7+
impl<'a> LifetimeToType<'a> for () {
8+
type Out = &'a ();
9+
}
10+
11+
fn id<'a>(val: &'a ()) -> <() as LifetimeToType<'a>>::Out {
12+
val
13+
}
14+
15+
fn assert_fn<F: for<'a> FnOnce(&'a ()) -> <() as LifetimeToType<'a>>::Out>(_func: F) { }
16+
17+
fn main() {
18+
assert_fn(id);
19+
}

0 commit comments

Comments
 (0)