pub enum ArrayLen {
Fixed(u64),
Unknown,
Star,
Variable(VlaId),
}Expand description
How many elements an array has, which is four different answers in C.
Variants§
Fixed(u64)
int a[4]. The count of elements, not the size in bytes.
Unknown
int a[], an incomplete array type. It has an element type and no size, and it is
completed by an initializer or by a later declaration.
Star
int a[*], a variably modified type in a prototype, where the size exists but is not
available to the declaration that mentions it.
Variable(VlaId)
int a[n], a variable length array. The size expression stays in the AST, and the
type carries only the identity of the one that made it, because two variable length
arrays written with the same element type are still distinct types.
Trait Implementations§
impl Copy for ArrayLen
impl Eq for ArrayLen
Source§impl Ord for ArrayLen
impl Ord for ArrayLen
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for ArrayLen
impl PartialOrd for ArrayLen
impl StructuralPartialEq for ArrayLen
Auto Trait Implementations§
impl Freeze for ArrayLen
impl RefUnwindSafe for ArrayLen
impl Send for ArrayLen
impl Sync for ArrayLen
impl Unpin for ArrayLen
impl UnsafeUnpin for ArrayLen
impl UnwindSafe for ArrayLen
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