]>
git.proxmox.com Git - rustc.git/blob - tests/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs
5 impl<T
> Trait
<'_
, '_
> for T {}
7 // `Invert<'a> <: Invert<'b>` if `'b: 'a`, unlike 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 Invert
<'a
>(fn(&'a
u8));
14 fn upper_bounds
<'a
, 'b
, 'c
, 'd
, 'e
>(a
: Invert
<'a
>, b
: Invert
<'b
>) -> impl Trait
<'d
, 'e
>
20 // Representing the where clauses as a graph, where `A: B` is an
30 // Meanwhile we return a value &'0 u8 where we have the constraints:
38 // Here, ignoring the "in" constraint, the minimal choice for `'0`
39 // is `'c`, but that is not in the "in set". Still, that reduces
40 // the range of options in the "in set" to just `'d` (`'e: 'c`
42 let p
= if condition() { a }
else { b }
;
46 fn condition() -> bool
{