rust/src/librustc/ty
bors e232636693 Auto merge of #59897 - tmandry:variantful-generators, r=eddyb
Multi-variant layouts for generators

This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants.

Required for optimizing generator layouts (#52924).

There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible.

This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator.

Also, fixes #59972.

Future work:
- Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924)
- In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172)
- Preserve debuginfo scopes across generator yield points
2019-05-04 03:18:14 +00:00
..
inhabitedness Update handling of Tuple 2019-04-26 21:09:32 +01:00
print rustc: rename hir::def::Def to Res (short for "resolution"). 2019-05-03 22:50:19 +03:00
query rustc: use DefKind instead of Def, where possible. 2019-05-03 22:50:09 +03:00
_match.rs Fix rebase from LazyConst removal 2019-05-01 23:11:19 +01:00
adjustment.rs refactor Adjustment to use new PointerCast enum 2019-04-16 13:40:04 +05:30
binding.rs move librustc to 2018 2019-02-05 12:45:47 -06:00
cast.rs Use derive macro for HashStable 2019-03-13 00:03:13 +01:00
codec.rs Add DropArena and use it to allocate types with few allocations 2019-04-05 00:55:09 +02:00
constness.rs Add rustc_allow_const_fn_ptr 2019-04-23 15:55:31 -07:00
context.rs rustc: rename hir::def::Def to Res (short for "resolution"). 2019-05-03 22:50:19 +03:00
erase_regions.rs Update existing usages 2019-04-25 22:05:04 +01:00
error.rs Fix rebase from LazyConst removal 2019-05-01 23:11:19 +01:00
fast_reject.rs move librustc to 2018 2019-02-05 12:45:47 -06:00
flags.rs Add ConstValue::Placeholder 2019-05-01 23:10:57 +01:00
fold.rs Fix rebase from LazyConst removal 2019-05-01 23:11:19 +01:00
instance.rs Merge DefPathData::VariantCtor and DefPathData::StructCtor 2019-03-24 17:59:18 +03:00
layout.rs Auto merge of #59897 - tmandry:variantful-generators, r=eddyb 2019-05-04 03:18:14 +00:00
mod.rs Auto merge of #59897 - tmandry:variantful-generators, r=eddyb 2019-05-04 03:18:14 +00:00
outlives.rs move librustc to 2018 2019-02-05 12:45:47 -06:00
relate.rs Remove spurious assertion 2019-05-01 23:11:19 +01:00
steal.rs Remove stolen 2019-02-15 03:51:48 +01:00
structural_impls.rs rustc: rename hir::def::Def to Res (short for "resolution"). 2019-05-03 22:50:19 +03:00
sty.rs Auto merge of #59897 - tmandry:variantful-generators, r=eddyb 2019-05-04 03:18:14 +00:00
subst.rs Add expect_ty method to Kind 2019-04-26 20:57:13 +01:00
trait_def.rs Update trait_impls_of 2019-04-25 18:23:35 +02:00
util.rs Auto merge of #60195 - varkor:commontypes-to-common, r=eddyb 2019-05-01 09:32:58 +00:00
walk.rs Update handling of Tuple 2019-04-26 21:09:32 +01:00
wf.rs Create ShallowResolver 2019-05-01 23:11:20 +01:00