rust/tests/ui/async-await/in-trait
bors 330727467b Auto merge of #112682 - spastorino:new-rpitit-21, r=compiler-errors
Add bidirectional where clauses on RPITIT synthesized GATs

Given the following:

```rust
struct MyStruct<'a, T>(&'a T);

trait MyTrait<'a, T> {
    fn my_fn<'b, 'c, 'd, V>(item: &'c String) -> impl Sized + 'a + 'b + 'c where V: 'b, V: 'd;
}

impl<'a, T> MyTrait<'a, T> for MyStruct<'a, T> {
    fn my_fn<'b, 'c, 'd, V>(_: &'c String) -> impl Sized + 'a + 'b + 'c
    where
        V: 'b,
        V: 'd,
    {
        unimplemented!();
    }
}
```

We need the desugaring to be:

```rust
trait MyTrait<'a, T> {
    type MyFn<'bf, 'df, Vf, 'a2, 'b2, 'c2>: Sized + 'a2 + 'b2 + 'c2 where Vf: 'b2, 'a2: 'a, 'a: 'a2, 'b2: 'bf, 'bf: 'b2;

    fn my_fn<'b, 'c, 'd, V>(item: &'c String) -> MyStruct<'a>::MyFn<'b, 'd, V, 'a, 'b, 'c> where V: 'b, V: 'd {
        type opaque<'a3, 'b3, 'c3>;
    };
}

impl<'a, T> MyIter<'a, T> for MyStruct<'a, T> {
    type MyFn<'bf, 'df, Vf, 'a2, 'b2, 'c2> = impl Sized + 'a2 + 'b2 + 'c2 where Vf: b2, 'a2: 'a, 'a: 'a2, 'b2: 'bf, 'bf: 'b2;

    fn my_fn<'b, 'c, 'd, V>(_: &'c String) -> MyStruct<'a>::MyFn<'a, 'b, 'c, V> where V: 'b, V: 'd {
        type opaque<'a3, 'b3, 'c3>;
        unimplemented!();
    }
}
```

This PR adds the where clauses for the `MyFn` generated GATs.

This is a draft with a very ugly solution so we can make comments over concrete code.

r? `@compiler-errors`
2023-06-29 21:24:51 +00:00
..
async-associated-types2.rs Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
async-associated-types.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-default-fn-overridden.rs Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
async-example-desugared-boxed-in-trait.current.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-boxed-in-trait.next.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-boxed-in-trait.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-boxed.current.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-boxed.next.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-boxed.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-extra.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-in-trait.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-manual.current.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-manual.next.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared-manual.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example-desugared.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-example.rs
async-generics-and-bounds.current.stderr Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-15 16:58:37 -03:00
async-generics-and-bounds.next.stderr Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-15 16:58:37 -03:00
async-generics-and-bounds.rs Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-15 16:58:37 -03:00
async-generics.current.stderr Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-15 16:58:37 -03:00
async-generics.next.stderr Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-15 16:58:37 -03:00
async-generics.rs Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-15 16:58:37 -03:00
async-lifetimes-and-bounds.rs Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
async-lifetimes.rs Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
async-recursive-generic.current.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-recursive-generic.next.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-recursive-generic.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-recursive.current.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-recursive.next.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
async-recursive.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
bad-signatures.current.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
bad-signatures.next.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
bad-signatures.rs Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
dont-project-to-specializable-projection.current.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
dont-project-to-specializable-projection.next.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
dont-project-to-specializable-projection.rs Specialization involving RPITITs is broken so ignore the diagnostic differences for them 2023-03-28 17:54:24 -03:00
early-bound-1.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
early-bound-2.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
fn-not-async-err2.current.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
fn-not-async-err2.next.stderr Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
fn-not-async-err2.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
fn-not-async-err.rs
fn-not-async-err.stderr
generics-mismatch.current.stderr Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests 2023-03-17 16:01:53 -03:00
generics-mismatch.next.stderr Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests 2023-03-17 16:01:53 -03:00
generics-mismatch.rs Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests 2023-03-17 16:01:53 -03:00
generics-mismatch.stderr Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests 2023-03-17 16:01:53 -03:00
implied-bounds.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
issue-102138.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
issue-102219.rs Run existing async in traits tests using -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-12 10:50:32 -03:00
issue-102310.rs Fix generics_of for impl's RPITIT synthesized associated type 2023-03-17 20:01:57 -03:00
issue-104678.rs Do not feed param_env for RPITITs impl side 2023-03-22 14:06:22 -03:00
lifetime-mismatch.current.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
lifetime-mismatch.next.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
lifetime-mismatch.rs Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
missing-send-bound.current.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
missing-send-bound.next.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
missing-send-bound.rs Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
nested-rpit.rs Don't duplicate anonymous lifetimes for async fn in traits 2023-04-28 20:21:03 +00:00
normalize-opaque-with-bound-vars.rs More tests 2023-06-27 21:36:15 +00:00
object-safety.current.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
object-safety.next.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
object-safety.rs Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
return-type-suggestion.current.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
return-type-suggestion.next.stderr Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00
return-type-suggestion.rs Mark RPITIT and AFIT as no longer incomplete 2023-05-02 05:04:50 +00:00