I use a large stack for my program, so I tried to use lazy_static.
#[macro_use]
extern crate lazy_static;
lazy_static! {
static ref VEC: Vec<i32> = {
let mut m = Vec::with_capacity(1000);
m
};
}
fn main() {
VEC.push(3);
}
The compiler complains “cannot borrow immutable borrowed content as mutable”.
I tried to insert “mut” in declaration part of VEC and failed.
How can I use mutable lazy_static?