Skip to content

Commit 6548be2

Browse files
committed
'fieldless enums' is not what I meant -- it's empty/uninhabited enums, really
1 parent 96bb8b3 commit 6548be2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/librustc_mir/interpret/validity.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,12 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
579579
}
580580

581581
// Check primitive types. We do this after checking for uninhabited types,
582-
// to exclude fieldless enums (that also appear as fieldless unions here).
582+
// to exclude uninhabited enums (that also appear as fieldless unions here).
583583
// Primitives can have varying layout, so we check them separately and before aggregate
584584
// handling.
585585
// It is CRITICAL that we get this check right, or we might be validating the wrong thing!
586586
let primitive = match op.layout.fields {
587587
// Primitives appear as Union with 0 fields - except for Boxes and fat pointers.
588-
// (Fieldless enums also appear here, but they are uninhabited and thus handled above.)
589588
layout::FieldPlacement::Union(0) => true,
590589
_ => op.layout.ty.builtin_deref(true).is_some(),
591590
};

src/librustc_target/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ impl Niche {
872872
#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)]
873873
pub struct LayoutDetails {
874874
/// Says where the fields are located within the layout.
875-
/// Primitives and fieldless enums appear as unions without fields.
875+
/// Primitives and uninhabited enums appear as unions without fields.
876876
pub fields: FieldPlacement,
877877

878878
/// Encodes information about multi-variant layouts.

0 commit comments

Comments
 (0)