@@ -871,26 +871,26 @@ impl Niche {
871
871
872
872
#[ derive( PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
873
873
pub struct LayoutDetails {
874
- /// Says where the fields are located.
874
+ /// Says where the fields are located within the layout .
875
875
/// Primitives and fieldless enums appear as unions without fields.
876
876
pub fields : FieldPlacement ,
877
877
878
878
/// Encodes information about multi-variant layouts.
879
- /// Even with `Multiple` variants, a layout can still have fields! Those are then
879
+ /// Even with `Multiple` variants, a layout still has its own fields! Those are then
880
880
/// shared between all variants. One of them will be the discriminant,
881
881
/// but e.g. generators can have more.
882
882
///
883
- /// A layout-guided recursive descent must first look at all the fields,
884
- /// and only then check if this is a multi-variant layout and if so, proceed
885
- /// with the active variant.
883
+ /// To access all fields of this layout, both `fields` and the fields of the active variant
884
+ /// must be taken into account.
886
885
pub variants : Variants ,
887
886
888
887
/// The `abi` defines how this data is passed between functions, and it defines
889
888
/// value restrictions via `valid_range`.
890
889
///
891
- /// Note that this is entirely orthogonal to the recursive structrue defined by
890
+ /// Note that this is entirely orthogonal to the recursive structure defined by
892
891
/// `variants` and `fields`; for example, `ManuallyDrop<Result<isize, isize>>` has
893
- /// `Abi::ScalarPair`! So, having a non-`Aggregate` `abi` should not stop a recursive descent.
892
+ /// `Abi::ScalarPair`! So, even with non-`Aggregate` `abi`, `fields` and `variants`
893
+ /// have to be taken into account to find all fields of this layout.
894
894
pub abi : Abi ,
895
895
896
896
/// The leaf scalar with the largest number of invalid values
0 commit comments