Skip to content

Cannot Use Heapless Vec with Capacity > 32 Due to Default Impls #215

Closed
@pperanich

Description

@pperanich

With the current implementation of variable-length fields (when using heapless Vecs), you are limited to a Vec of length 32 or less. This is because the underlying storage is a [u8; N], and Default::default() is used to initialize the static cell. However, the Default trait in the standard library is only implemented for [u8; 32] and smaller. Attempting to use a larger heapless Vec leads to a compile error (rust-lang/rust#61415).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions