Skip to content

Commit 4d11206

Browse files
committed
Tweak comments.
1 parent 6ecf30d commit 4d11206

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: compiler/rustc_metadata/src/rmeta/encoder.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1216,12 +1216,13 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
12161216
}
12171217
}
12181218
));
1219+
} else {
1220+
// For non-enum, there is only one variant, and its def_id is the adt's.
1221+
debug_assert_eq!(adt_def.variants().len(), 1);
1222+
debug_assert_eq!(adt_def.non_enum_variant().def_id, def_id);
1223+
// Therefore, the loop over variants will encode its fields as the adt's children.
12191224
}
12201225

1221-
// In some cases, along with the item itself, we also
1222-
// encode some sub-items. Usually we want some info from the item
1223-
// so it's easier to do that here then to wait until we would encounter
1224-
// normally in the visitor walk.
12251226
for variant in adt_def.variants().iter() {
12261227
let data = VariantData {
12271228
discr: variant.discr,

0 commit comments

Comments
 (0)