1 // In this fn, the type `F` is a function that takes a reference to a
2 // struct and returns another reference with the same lifetime.
4 // Meanwhile, the bare fn `foo` takes a reference to a struct with
5 // *ANY* lifetime and returns a reference with the 'static lifetime.
6 // This can safely be considered to be an instance of `F` because all
7 // lifetimes are sublifetimes of 'static.
12 #![allow(unused_variables)]
13 #![allow(non_snake_case)]
17 // Given 'cx, return 'cx
18 type F = for<'cx> fn(&'cx S) -> &'cx S;
21 // Given anything, return 'static
22 type G = for<'cx> fn(&'cx S) -> &'static S;
26 fn foo(x: &S) -> &'static S {
31 fn bar<'a,'b>(x: &'a S) -> &'b S {
35 // Meets F, but not G.