Skip to content

Can't use FixedVec type in lazy_static #17

@ethindp

Description

@ethindp

I am attempting to declare a FixedVec in a lazy_static! declaration. However, I repeatedly keep getting error 0106. I have tried various ways of initializing it; right now I have this code:

static SPACE: [(Option::<char>, Option::<KeyCode>); 512] = {
    alloc_stack!([(Option::<char>, Option::<KeyCode>); 512])
};

And then this:

lazy_static! {
    static ref KEY_QUEUE: Mutex<FixedVec> =
        Mutex::new(FixedVec::new(SPACE));
//...

However, this does not seem to work. I have tried declaring the type that the vec will hold as though I were declaring a normal Vec<>, however tha didn't work either. How exactly would I go about this?

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