Skip to content

Commit 4aecbdb

Browse files
committed
Document the index used in AggregateKind::Adt
1 parent fd45d48 commit 4aecbdb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc/mir/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,9 @@ pub enum AggregateKind<'tcx> {
15201520
/// active field number and is present only for union expressions
15211521
/// -- e.g. for a union expression `SomeUnion { c: .. }`, the
15221522
/// active field index would identity the field `c`
1523+
///
1524+
/// For enums, the second field is the index of the variant
1525+
/// within AdtDef::fields
15231526
Adt(&'tcx AdtDef, usize, &'tcx Substs<'tcx>, Option<usize>),
15241527

15251528
Closure(DefId, ClosureSubsts<'tcx>),

0 commit comments

Comments
 (0)