You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uninitialized fixed size arrays always throw Use of possibly uninitialized variable errors, even if all the indices are allocated. Is there a way around this? If not, it shouldn't be possible to create uninitialized fixed size arrays.
structNum{s:int}fnmain(){let s = box Num{s:5};letmut a:[&Num, ..5];
a[0] = &*s; a[1] = &*s; a[2] = &*s; a[3] = &*s; a[4] = &*s;println!("{}", a[0].s)// error: use of possibly uninitialized variable: `a[..].s`}