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

35 lines
1.1 KiB
Plaintext
Raw Normal View History

error[E0599]: no method named `clone` found for struct `Box<dyn Foo>` in the current scope
--> $DIR/unique-object-noncopyable.rs:24:16
2018-08-08 12:28:26 +00:00
|
LL | trait Foo {
| ---------
| |
| doesn't satisfy `dyn Foo: Clone`
| doesn't satisfy `dyn Foo: Sized`
...
2019-03-09 12:03:44 +00:00
LL | let _z = y.clone();
| ^^^^^ method not found in `Box<dyn Foo>`
|
2020-06-12 02:31:49 +00:00
::: $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | pub struct Box<T: ?Sized>(Unique<T>);
| ------------------------------------- doesn't satisfy `Box<dyn Foo>: Clone`
|
2020-06-12 02:31:49 +00:00
::: $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | fn clone(&self) -> Self;
| -----
| |
| the method is available for `Arc<Box<dyn Foo>>` here
| the method is available for `Rc<Box<dyn Foo>>` here
2018-08-08 12:28:26 +00:00
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`dyn Foo: Sized`
which is required by `Box<dyn Foo>: Clone`
`dyn Foo: Clone`
which is required by `Box<dyn Foo>: Clone`
2018-08-08 12:28:26 +00:00
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.