]>
git.proxmox.com Git - rustc.git/blob - tests/ui/impl-trait/feature-self-return-type.rs
3 // This test checks that we emit the correct borrowck error when `Self` or a projection is used as
4 // a return type. See #61949 for context.
12 pub fn new(_bar
: &'a
i32) -> impl Into
<Self> {
23 //~^ ERROR `bar` does not live long enough
35 impl<T
> FooLike
for Foo
<T
> {
45 fn make_assoc(self) -> Self::Assoc
;
48 /// `T::Assoc` can't be normalized any further here.
49 fn foo
<T
: Trait
>(x
: T
) -> impl FooLike
<Output
= T
::Assoc
> {
53 impl<'a
> Trait
for &'
a () {
56 fn make_assoc(self) -> &'
a () { &() }
63 //~^ ERROR `y` does not live long enough
69 // Same with lifetimes in the trait
77 fn make_assoc(self) -> Self::Assoc
;
80 /// Missing bound constraining `Assoc`, `T::Assoc` can't be normalized further.
81 fn foo
<'a
, T
: Trait
<'a
>>(x
: T
) -> impl FooLike
<Output
= T
::Assoc
> {
85 impl<'a
> Trait
<'a
> for &'
a () {
88 fn make_assoc(self) -> &'
a () { &() }
95 //~^ ERROR `y` does not live long enough