stable_mir::mir::body

Type Alias FieldIdx

source
pub type FieldIdx = usize;
Expand description

The source-order index of a field in a variant.

For example, in the following types,

enum Demo1 {
   Variant0 { a: bool, b: i32 },
   Variant1 { c: u8, d: u64 },
}
struct Demo2 { e: u8, f: u16, g: u8 }

a’s FieldIdx is 0, b’s FieldIdx is 1, c’s FieldIdx is 0, and g’s FieldIdx is 2.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 8 bytes