rust/compiler
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
..
rustc
rustc_abi Auto merge of #112062 - lukas-code:unsized-layout, r=wesleywiser 2023-06-13 22:34:59 +00:00
rustc_apfloat
rustc_arena Extend unused_must_use to cover block exprs 2023-06-15 17:59:13 +08:00
rustc_ast Syntatically accept become expressions 2023-06-19 12:54:34 +00:00
rustc_ast_lowering Do not generate lifetime_mapping for RPIT no in_trait 2023-06-29 14:26:28 -03:00
rustc_ast_passes Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr 2023-06-27 21:31:47 +00:00
rustc_ast_pretty Syntatically accept become expressions 2023-06-19 12:54:34 +00:00
rustc_attr Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck don't suggest move for borrows that aren't closures 2023-06-28 23:56:58 +02:00
rustc_builtin_macros Auto merge of #112802 - lukas-code:fancy-bool, r=Nilstrieb 2023-06-24 11:43:41 +00:00
rustc_codegen_cranelift Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
rustc_codegen_gcc Auto merge of #112814 - antoyo:sync-cg_gcc-2023-06-19, r=bjorn3 2023-06-22 02:11:08 +00:00
rustc_codegen_llvm Auto merge of #112516 - erikdesjardins:loop, r=davidtwco 2023-06-27 15:01:56 +00:00
rustc_codegen_ssa Rollup merge of #112946 - nnethercote:improve-cgu-naming-and-ordering, r=wesleywiser 2023-06-29 03:29:32 +09:00
rustc_const_eval remove FIXME and add test 2023-06-28 07:59:36 -04:00
rustc_data_structures Rollup merge of #112538 - ndrewxie:issue-84447-partial-1, r=compiler-errors 2023-06-21 20:00:49 +02:00
rustc_driver fix spelling error 2023-06-05 16:01:09 +02:00
rustc_driver_impl Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
rustc_error_codes Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
rustc_error_messages Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
rustc_errors s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_expand Rollup merge of #111571 - jhpratt:proc-macro-span, r=m-ou-se 2023-06-28 18:28:46 +05:30
rustc_feature Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_fluent_macro Fix diagnostics with errors 2023-05-26 10:44:18 +00:00
rustc_fs_util
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
rustc_hir_analysis Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
rustc_hir_pretty hir: Add Become expression kind 2023-06-26 08:56:32 +00:00
rustc_hir_typeck Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb 2023-06-27 22:10:15 +02:00
rustc_incremental Applied nits 2023-06-11 22:45:04 -04:00
rustc_index Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth 2023-05-25 00:33:43 +00:00
rustc_infer avoid using format!("{}", ..) 2023-06-27 22:12:29 +09:00
rustc_interface Auto merge of #112708 - flip1995:clippy-freezing-pc-with-ice, r=oli-obk 2023-06-28 09:40:07 +00:00
rustc_lexer Don't try to eat non-existent decimal digits. 2023-05-15 18:33:12 +10:00
rustc_lint Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_lint_defs Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_llvm Add SafeStack support to rustc 2023-05-26 15:18:54 -04:00
rustc_log Stabilize IsTerminal 2023-04-10 17:24:23 +09:00
rustc_macros Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwco 2023-06-28 03:47:02 +00:00
rustc_metadata Auto merge of #98867 - cjgillot:metaloop, r=oli-obk 2023-06-28 16:16:27 +00:00
rustc_middle Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_mir_build remove cruft 2023-06-28 01:55:32 -04:00
rustc_mir_dataflow Export AnalysisResults trait in rustc_mir_dataflow 2023-06-27 11:35:32 +02:00
rustc_mir_transform Auto merge of #112307 - lcnr:operand-ref, r=compiler-errors 2023-06-28 00:41:37 +00:00
rustc_monomorphize Tweak thread names for CGU processing. 2023-06-26 09:14:45 +10:00
rustc_parse Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr 2023-06-27 21:31:47 +00:00
rustc_parse_format Fix typos in compiler 2023-04-10 22:02:52 +02:00
rustc_passes Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwco 2023-06-28 03:47:02 +00:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_query_impl Avoid calling queries during query stack printing 2023-06-27 16:12:07 +02:00
rustc_query_system Rollup merge of #112333 - Zoxc:try_collect_active_jobs-deadlock, r=cjgillot 2023-06-08 12:36:18 +02:00
rustc_resolve Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb 2023-06-27 22:10:15 +02:00
rustc_serialize Fix the FileEncoder buffer size. 2023-05-15 08:59:11 +10:00
rustc_session Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb 2023-06-27 22:10:15 +02:00
rustc_smir Rollup merge of #112232 - fee1-dead-contrib:match-eq-const-msg, r=b-naber 2023-06-19 17:53:33 -07:00
rustc_span Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_symbol_mangling Add AliasKind::Weak for type aliases. 2023-06-16 19:39:48 +00:00
rustc_target Rollup merge of #111326 - he32:netbsd-aarch64-be, r=oli-obk 2023-06-26 11:58:43 +02:00
rustc_trait_selection Auto merge of #113108 - compiler-errors:normalize-opaques-with-late-bound-vars-again, r=jackh726 2023-06-29 15:37:11 +00:00
rustc_traits Remove unnecessary DefineOpaqueTypes::Bubble from codegen 2023-06-27 21:36:15 +00:00
rustc_transmute Safe Transmute: Refactor error handling and Answer type 2023-06-12 16:56:21 -07:00
rustc_ty_utils Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
rustc_type_ir Add AliasKind::Weak for type aliases. 2023-06-16 19:39:48 +00:00