rust/src/test/ui/unique-object-noncopyable.stderr

35 lines
1.3 KiB
Plaintext

error[E0599]: no method named `clone` found for struct `std::boxed::Box<dyn Foo>` in the current scope
--> $DIR/unique-object-noncopyable.rs:24:16
|
LL | trait Foo {
| ---------
| |
| doesn't satisfy `dyn Foo: std::clone::Clone`
| doesn't satisfy `dyn Foo: std::marker::Sized`
...
LL | let _z = y.clone();
| ^^^^^ method not found in `std::boxed::Box<dyn Foo>`
|
::: $SRC_DIR/liballoc/boxed.rs:LL:COL
|
LL | pub struct Box<T: ?Sized>(Unique<T>);
| ------------------------------------- doesn't satisfy `std::boxed::Box<dyn Foo>: std::clone::Clone`
|
::: $SRC_DIR/libcore/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| -----
| |
| the method is available for `std::sync::Arc<std::boxed::Box<dyn Foo>>` here
| the method is available for `std::rc::Rc<std::boxed::Box<dyn Foo>>` here
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`dyn Foo: std::marker::Sized`
which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
`dyn Foo: std::clone::Clone`
which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.