pub struct Address {
pub base: Base,
pub offset: i128,
}Expand description
An address constant: some object, and how far into it.
This is what &x, a + 1 and &s.field fold to, and it is the reason folding hands back
something richer than a number. The value is not known here and will not be known until the
linker places the object, so what a static initializer needs is not the value but the pair
that names it, which is what an object file’s relocation records.
A pointer with no object behind it is not one of these. (int *)4 folds to Const::Int,
because four is the whole answer and nothing has to be relocated.
Fields§
§base: BaseThe object the address is into.
offset: i128How many bytes into it, which a member or a subscript adds to and which may be outside
the object: &a[10] on an int a[10] is a valid address constant and is one past it.
Trait Implementations§
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
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
Mutably borrows from an owned value. Read more