1 // Test that we are special casing "outlives" for opaque types.
3 // The return type of a closure is not required to outlive the closure. As such
4 // the following code would not compile if we used a standard outlives check
5 // when checking the return type, because the return type of the closure would
6 // be `&ReEmpty i32`, and we don't allow `ReEmpty` to occur in the concrete
7 // type used for an opaque type.
9 // However, opaque types are special cased to include check all regions in the
10 // concrete type against the bound, which forces the return type to be
11 // `&'static i32` here.
13 // build-pass (FIXME(62277): could be check-pass?)
15 fn make_identity() -> impl Sized {
19 fn make_identity_static() -> impl Sized + 'static {