pub struct Arg {
pub slot: Slot,
pub layout: LayoutId,
}Expand description
One argument of a call: where the value is, and what it is.
A slot alone says where an operand begins and never how wide it is. A
scalar is described by the Repr of the slot it sits in and a reference
by the header of the object it names, but an inline struct or enum is a
run of words with nothing attached to it at all — a Point in a frame is
described by neither. So a callee that is polymorphic over the values it
is handed had no way to read one: "{Point(x: 1)}" rendered the first
word, a == b on two structs compared the first word, and the operations
that put a whole value into a collection refused rather than store half of
one.
Carrying the layout beside the slot answers all of them at once, and it is carried for every argument rather than for the calls that turned out to need it. A layout is what an argument is; which callee reads it is not the argument’s business, and one rule the verifier checks everywhere is worth more than the word this costs at the sites that could have done without.
Fields§
§slot: SlotThe first slot of the value location in the caller’s frame.
layout: LayoutIdThe layout of that location, which is what says how wide it is.
Trait Implementations§
impl Copy for Arg
impl Eq for Arg
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl Freeze for Arg
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnsafeUnpin for Arg
impl UnwindSafe for Arg
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.