Function rustc_const_eval::util::aggregate::expand_aggregate
source · pub fn expand_aggregate<'tcx>(
orig_lhs: Place<'tcx>,
operands: impl Iterator<Item = (Operand<'tcx>, Ty<'tcx>)> + TrustedLen,
kind: AggregateKind<'tcx>,
source_info: SourceInfo,
tcx: TyCtxt<'tcx>
) -> impl Iterator<Item = Statement<'tcx>> + TrustedLen
Expand description
Expand lhs = Rvalue::Aggregate(kind, operands)
into assignments to the fields.
Produces something like
(lhs as Variant).field0 = arg0; // We only have a downcast if this is an enum (lhs as Variant).field1 = arg1; discriminant(lhs) = variant_index; // If lhs is an enum or generator.