2 // build-pass (FIXME(62277): could be check-pass?)
5 impl<T> Trait<'_, '_> for T {}
7 // `Ordinary<'a> <: Ordinary<'b>` if `'a: 'b`, as with most types.
9 // I am purposefully avoiding the terms co- and contra-variant because
10 // their application to regions depends on how you interpreted Rust
11 // regions. -nikomatsakis
12 struct Ordinary<'a>(&'a u8);
14 // Here we wind up selecting `'e` in the hidden type because
15 // we need something outlived by both `'a` and `'b` and only `'e` applies.
17 fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
31 // but we don't have it.
33 // We are forced to pick that '0 = 'e, because only 'e is outlived by *both* 'a and 'b.
34 let p = if condition() { a } else { b };
38 fn condition() -> bool {