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