]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.rs
4 impl<T
> Trait
<'_
, '_
> for T {}
6 // `Ordinary<'a> <: Ordinary<'b>` if `'a: 'b`, as with most types.
8 // I am purposefully avoiding the terms co- and contra-variant because
9 // their application to regions depends on how you interpreted Rust
10 // regions. -nikomatsakis
11 struct Ordinary
<'a
>(&'a
u8);
13 // Here we get an error because none of our choices (either `'d` nor `'e`) are outlived
14 // by both `'a` and `'b`.
16 fn upper_bounds
<'a
, 'b
, 'c
, 'd
, 'e
>(a
: Ordinary
<'a
>, b
: Ordinary
<'b
>) -> impl Trait
<'d
, 'e
>
17 //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds
22 // Hidden type `Ordinary<'0>` with constraints:
29 if condition() { a }
else { b }
32 fn condition() -> bool
{