1
Fork 0
rust/compiler/rustc_middle/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
..
dep_graph Reduce exposure of things. 2023-11-16 16:49:22 +11:00
hir Rename hir::Node::Local into hir::Node::LetStmt 2024-03-22 20:48:36 +01:00
hooks Rename mir_const query to mir_built 2024-03-20 09:05:22 +00:00
infer add comment 2024-02-22 18:54:51 +01:00
middle Rename BuiltinLintDiagnostics as BuiltinLintDiag. 2024-03-05 12:15:10 +11:00
mir Rollup merge of #123021 - compiler-errors:coroutine-layout-lol, r=oli-obk 2024-03-27 10:13:43 +01:00
query Remove CacheSelector trait now that we can use GATs 2024-03-26 11:03:23 +00:00
thir Add barest-bones deref patterns 2024-03-20 22:30:27 +01:00
traits cleanup + review 2024-03-18 18:13:25 +01:00
ty Rollup merge of #123021 - compiler-errors:coroutine-layout-lol, r=oli-obk 2024-03-27 10:13:43 +01:00
util Make span_bug panic site useful again 2024-03-19 09:19:12 +00:00
arena.rs Create some minimal HIR for associated opaque types 2024-03-13 17:33:09 +03:00
error.rs Rename DiagnosticMessage as DiagMessage. 2024-03-05 12:14:49 +11:00
lib.rs step cfgs 2024-03-20 08:49:13 -04:00
lint.rs Guard decorate on when not to skip instead 2024-03-17 15:07:22 +00:00
macros.rs Remove unnecessary braces from span_bug 2024-03-21 11:24:24 -04:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs Remove outdated references to librustc_middle. 2024-01-05 16:34:52 +00:00
thir.rs Implement macro-based deref!() syntax for deref patterns 2024-03-21 11:42:49 -04:00
values.rs make Representability::Infinite carry ErrorGuaranteed 2024-03-14 20:52:13 +01:00