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