rust/compiler/rustc_ty_utils/src
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
..
abi.rs Transform async ResumeTy in generator transform 2023-01-19 09:03:05 +01:00
assoc.rs Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
common_traits.rs Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
consts.rs ConstBlocks are poly if their substs are poly 2023-01-16 20:09:31 +00:00
errors.rs Migrate all diagnostics 2022-10-23 10:09:44 +02:00
implied_bounds.rs fix various subst_identity vs skip_binder 2023-01-14 00:30:03 -07:00
instance.rs Rename some compare_method functions 2022-12-24 21:36:58 +00:00
layout_sanity_check.rs stricter alignment enforcement for ScalarPair and Vector 2022-11-28 15:09:56 +01:00
layout.rs layout_of: T: Thin implies sizeof(&T) == sizeof(usize) 2023-01-04 00:56:05 +00:00
lib.rs Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
needs_drop.rs Combine identical alias arms 2022-12-13 17:48:55 +00:00
representability.rs Rewrite representability 2022-10-07 09:33:46 -05:00
structural_match.rs Move has_structural_eq_impls provider to rustc_ty_utils 2022-12-08 05:16:48 +00:00
ty.rs change impl_trait_ref query to return EarlyBinder; remove bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata 2023-01-14 00:29:56 -07:00