mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 23:38:41 +08:00
18 lines
779 B
Plaintext
18 lines
779 B
Plaintext
$ cargo build
|
|
Compiling gui v0.1.0 (file:///projects/gui)
|
|
error[E0038]: the trait `Clone` cannot be made into an object
|
|
--> src/lib.rs:2:21
|
|
|
|
|
2 | pub components: Vec<Box<dyn Clone>>,
|
|
| ^^^^^^^^^^^^^^^^^^^ `Clone` cannot be made into an object
|
|
|
|
|
= note: the trait cannot be made into an object because it requires `Self: Sized`
|
|
= note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0038`.
|
|
error: could not compile `gui`
|
|
|
|
To learn more, run the command again with --verbose.
|