rust/compiler
Arpad Borsos 96931a787a
Transform async ResumeTy in generator transform
- Eliminates all the `get_context` calls that async lowering created.
- Replace all `Local` `ResumeTy` types with `&mut Context<'_>`.

The `Local`s that have their types replaced are:
- The `resume` argument itself.
- The argument to `get_context`.
- The yielded value of a `yield`.

The `ResumeTy` hides a `&mut Context<'_>` behind an unsafe raw pointer, and the
`get_context` function is being used to convert that back to a `&mut Context<'_>`.

Ideally the async lowering would not use the `ResumeTy`/`get_context` indirection,
but rather directly use `&mut Context<'_>`, however that would currently
lead to higher-kinded lifetime errors.
See <https://github.com/rust-lang/rust/issues/105501>.

The async lowering step and the type / lifetime inference / checking are
still using the `ResumeTy` indirection for the time being, and that indirection
is removed here. After this transform, the generator body only knows about `&mut Context<'_>`.
2023-01-19 09:03:05 +01:00
..
rustc
rustc_abi Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_apfloat
rustc_arena
rustc_ast Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_ast_lowering Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_ast_passes
rustc_ast_pretty Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_attr
rustc_baked_icu_data
rustc_borrowck Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obk 2023-01-18 16:37:33 +00:00
rustc_builtin_macros Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_codegen_cranelift Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_codegen_gcc
rustc_codegen_llvm Auto merge of #106998 - matthiaskrgr:rollup-hmfisji, r=matthiaskrgr 2023-01-17 20:53:05 +00:00
rustc_codegen_ssa Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_const_eval Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_data_structures Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_driver Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_error_codes Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_error_messages Rollup merge of #106949 - compiler-errors:is-poly, r=BoxyUwU 2023-01-17 05:25:23 +01:00
rustc_errors Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_expand Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Transform async ResumeTy in generator transform 2023-01-19 09:03:05 +01:00
rustc_hir_analysis Stop using BREAK & CONTINUE in compiler 2023-01-17 23:17:51 -08:00
rustc_hir_pretty
rustc_hir_typeck Rollup merge of #107023 - scottmcm:stop-shouting, r=Nilstrieb 2023-01-18 18:00:30 -05:00
rustc_incremental Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_index
rustc_infer Stop using BREAK & CONTINUE in compiler 2023-01-17 23:17:51 -08:00
rustc_interface Rollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholk 2023-01-13 19:16:43 +01:00
rustc_lexer Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_lint Stop using BREAK & CONTINUE in compiler 2023-01-17 23:17:51 -08:00
rustc_lint_defs
rustc_llvm Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_log
rustc_macros Stop using BREAK & CONTINUE in compiler 2023-01-17 23:17:51 -08:00
rustc_metadata Rollup merge of #106917 - compiler-errors:const-closure-foreign, r=tmiasko 2023-01-18 18:00:29 -05:00
rustc_middle Transform async ResumeTy in generator transform 2023-01-19 09:03:05 +01:00
rustc_mir_build Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_mir_dataflow Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_mir_transform Transform async ResumeTy in generator transform 2023-01-19 09:03:05 +01:00
rustc_monomorphize Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_parse Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_parse_format Revert "Improve heuristics whether format_args string is a source literal" 2023-01-18 20:33:17 +01:00
rustc_passes Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_plugin_impl
rustc_privacy Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_query_impl
rustc_query_system Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_resolve Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_save_analysis
rustc_serialize
rustc_session Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_smir
rustc_span Transform async ResumeTy in generator transform 2023-01-19 09:03:05 +01:00
rustc_symbol_mangling
rustc_target Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_trait_selection Rollup merge of #107030 - albertlarsan68:patch-3, r=lcnr 2023-01-18 18:00:30 -05:00
rustc_traits Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726 2023-01-17 20:21:25 +01:00
rustc_transmute Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_ty_utils Transform async ResumeTy in generator transform 2023-01-19 09:03:05 +01:00
rustc_type_ir Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00