File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -438,7 +438,6 @@ This error indicates that the compiler found multiple functions with the
438438`#[start]` attribute. This is an error because there must be a unique entry
439439point into a Rust program. Example:
440440
441-
442441```
443442#![feature(start)]
444443
Original file line number Diff line number Diff line change @@ -50,11 +50,36 @@ match 5u32 {
5050"## ,
5151
5252E0161 : r##"
53+ A value was moved. However, its size was not known at compile time, and only
54+ values of a known size can be moved.
55+
56+ Erroneous code example:
57+
58+ ```compile_fail
59+ #![feature(box_syntax)]
60+
61+ fn main() {
62+ let array: &[isize] = &[1, 2, 3];
63+ let _x: Box<[isize]> = box *array;
64+ // error: cannot move a value of type [isize]: the size of [isize] cannot
65+ // be statically determined
66+ }
67+ ```
68+
5369In Rust, you can only move a value when its size is known at compile time.
5470
5571To work around this restriction, consider "hiding" the value behind a reference:
5672either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move
57- it around as usual.
73+ it around as usual. Example:
74+
75+ ```
76+ #![feature(box_syntax)]
77+
78+ fn main() {
79+ let array: &[isize] = &[1, 2, 3];
80+ let _x: Box<&[isize]> = box array; // ok!
81+ }
82+ ```
5883"## ,
5984
6085E0265 : r##"
You can’t perform that action at this time.
0 commit comments