Const/generic on stable Rust

Is there anyway to get this working on stable Rust ?

pub trait Foo {
    type Blah;
    const N: usize;

    fn write(b: &Self::Blah, out: &mut [u8; Self::N]);
}

This exists:

1 Like

Other than using typenum, no, unfortunately

1 Like