We currently only support structs with named fields living in memory (RAM), whereas tuple structs can live both in memory (via the Box) and on the stack. We should add the option of having structs with named fields on the stack such that this code compiles
struct FourVector {
t: u64,
x: u64,
y: u64,
z: u64,
}
let m: u64 = 1;
let c: u64 = 1;
let a: FourVector = FourVector {
t: m * c * c,
x: 0,
y: 0,
z: 0,
};
let f: u64 = a.t;
We already have support for methods and associated functions, so no change should be needed there.
We currently only support structs with named fields living in memory (RAM), whereas tuple structs can live both in memory (via the
Box
) and on the stack. We should add the option of having structs with named fields on the stack such that this code compilesWe already have support for methods and associated functions, so no change should be needed there.