]>
git.proxmox.com Git - rustc.git/blob - tests/ui/regions/regions-implied-bounds-projection-gap-1.rs
1 // Illustrates the "projection gap": in this test, even though we know
2 // that `T::Foo: 'x`, that does not tell us that `T: 'x`, because
3 // there might be other ways for the caller of `func` to show that
4 // `T::Foo: 'x` holds (e.g., where-clause).
10 // calling this fn should trigger a check that the type argument
11 // supplied is well-formed.
14 fn func
<'x
, T
:Trait1
<'x
>>(t
: &'x T
::Foo
)
17 //~^ ERROR the parameter type `T` may not live long enough
20 fn caller2
<'x
, T
:Trait1
<'x
>>(t
: &'x T
)
22 wf
::<&'x T
::Foo
>(); // OK
25 fn caller3
<'x
, T
:Trait1
<'x
>>(t
: &'x T
::Foo
)
27 wf
::<&'x T
::Foo
>(); // OK