about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-02-26 10:26:14 +0100
committerRalf Jung <post@ralfj.de>2020-02-26 10:26:18 +0100
commitdc92ad4d5bd06f7c62a924090001d1620fc74f3e (patch)
treeb21dbdbd41b57f4bdf202a32e16dc40c2278749c
parentbd979ed48cb94c271a953a32723aca73f4edb551 (diff)
adjust LayoutDetails comments
-rw-r--r--src/librustc_target/abi/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc_target/abi/mod.rs b/src/librustc_target/abi/mod.rs
index 447487e4fb2..67a5246012d 100644
--- a/src/librustc_target/abi/mod.rs
+++ b/src/librustc_target/abi/mod.rs
@@ -871,26 +871,26 @@ impl Niche {
 
 #[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)]
 pub struct LayoutDetails {
-    /// Says where the fields are located.
+    /// Says where the fields are located within the layout.
     /// Primitives and fieldless enums appear as unions without fields.
     pub fields: FieldPlacement,
 
     /// Encodes information about multi-variant layouts.
-    /// Even with `Multiple` variants, a layout can still have fields! Those are then
+    /// Even with `Multiple` variants, a layout still has its own fields! Those are then
     /// shared between all variants. One of them will be the discriminant,
     /// but e.g. generators can have more.
     ///
-    /// A layout-guided recursive descent must first look at all the fields,
-    /// and only then check if this is a multi-variant layout and if so, proceed
-    /// with the active variant.
+    /// To access all fields of this layout, both `fields` and the fields of the active variant
+    /// must be taken into account.
     pub variants: Variants,
 
     /// The `abi` defines how this data is passed between functions, and it defines
     /// value restrictions via `valid_range`.
     ///
-    /// Note that this is entirely orthogonal to the recursive structrue defined by
+    /// Note that this is entirely orthogonal to the recursive structure defined by
     /// `variants` and `fields`; for example, `ManuallyDrop<Result<isize, isize>>` has
-    /// `Abi::ScalarPair`! So, having a non-`Aggregate` `abi` should not stop a recursive descent.
+    /// `Abi::ScalarPair`! So, even with non-`Aggregate` `abi`, `fields` and `variants`
+    /// have to be taken into account to find all fields of this layout.
     pub abi: Abi,
 
     /// The leaf scalar with the largest number of invalid values