]>
git.proxmox.com Git - rustc.git/blob - src/test/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).
7 // ignore-compare-mode-nll
8 //[nll] compile-flags: -Z borrowck=mir
14 // calling this fn should trigger a check that the type argument
15 // supplied is well-formed.
18 fn func
<'x
, T
:Trait1
<'x
>>(t
: &'x T
::Foo
)
21 //~^ ERROR the parameter type `T` may not live long enough
24 fn caller2
<'x
, T
:Trait1
<'x
>>(t
: &'x T
)
26 wf
::<&'x T
::Foo
>(); // OK
29 fn caller3
<'x
, T
:Trait1
<'x
>>(t
: &'x T
::Foo
)
31 wf
::<&'x T
::Foo
>(); // OK