rust/compiler/rustc_ty_utils/src
Guillaume Gomez bffeb052d1
Rollup merge of #123021 - compiler-errors:coroutine-layout-lol, r=oli-obk
Make `TyCtxt::coroutine_layout` take coroutine's kind parameter

For coroutines that come from coroutine-closures (i.e. async closures), we may have two kinds of bodies stored in the coroutine; one that takes the closure's captures by reference, and one that takes the captures by move.

These currently have identical layouts, but if we do any optimization for these layouts that are related to the upvars, then they will diverge -- e.g. https://github.com/rust-lang/rust/pull/120168#discussion_r1536943728.

This PR relaxes the assertion I added in #121122, and instead make the `TyCtxt::coroutine_layout` method take the `coroutine_kind_ty` argument from the coroutine, which will allow us to differentiate these by-move and by-ref bodies.
2024-03-27 10:13:43 +01:00
..
abi.rs In ConstructCoroutineInClosureShim, pass receiver by ref, not pointer 2024-03-26 12:10:51 -04:00
assoc.rs Ensure nested statics have a HIR node to prevent various queries from ICEing 2024-03-19 09:38:15 +00:00
common_traits.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
consts.rs Rollup merge of #119307 - compiler-errors:pat-lifetimes, r=Nadrieril 2023-12-26 13:29:14 -05:00
errors.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
implied_bounds.rs Change DefKind::Static to a struct variant 2024-03-12 05:53:46 +00:00
instance.rs Fix ABI for FnMut/Fn impls for async closures 2024-03-19 16:59:24 -04:00
layout.rs Require coroutine kind type to be passed to TyCtxt::coroutine_layout 2024-03-24 21:12:49 -04:00
layout_sanity_check.rs fix failure to detect a too-big-type after adding padding 2023-10-27 18:07:53 +02:00
lib.rs Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
needs_drop.rs Dejargnonize subst 2024-02-12 15:46:35 +09:00
opaque_types.rs Rollup merge of #122366 - oli-obk:opaques_defined_by_overflow, r=lcnr 2024-03-12 09:04:02 -07:00
representability.rs make Representability::Infinite carry ErrorGuaranteed 2024-03-14 20:52:13 +01:00
sig_types.rs Manual rustfmt 2024-03-12 05:53:46 +00:00
structural_match.rs remove StructuralEq trait 2024-01-24 07:56:23 +01:00
ty.rs address nits 2024-03-18 22:28:29 +01:00