1 A value was moved whose size was not known at compile time.
3 Erroneous code example:
6 #![feature(box_syntax)]
9 let array: &[isize] = &[1, 2, 3];
10 let _x: Box<[isize]> = box *array;
11 // error: cannot move a value of type [isize]: the size of [isize] cannot
12 // be statically determined
16 In Rust, you can only move a value when its size is known at compile time.
18 To work around this restriction, consider "hiding" the value behind a reference:
19 either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move
20 it around as usual. Example:
23 #![feature(box_syntax)]
26 let array: &[isize] = &[1, 2, 3];
27 let _x: Box<&[isize]> = box array; // ok!