2020-09-02 07:40:56 +00:00
|
|
|
error[E0599]: no method named `clone` found for struct `Box<dyn Foo>` in the current scope
|
2020-04-01 01:10:13 +00:00
|
|
|
--> $DIR/unique-object-noncopyable.rs:24:16
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2020-02-18 07:22:19 +00:00
|
|
|
LL | trait Foo {
|
|
|
|
| ---------
|
|
|
|
| |
|
2020-09-02 07:40:56 +00:00
|
|
|
| doesn't satisfy `dyn Foo: Clone`
|
|
|
|
| doesn't satisfy `dyn Foo: Sized`
|
2020-02-18 07:22:19 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let _z = y.clone();
|
2020-09-02 07:40:56 +00:00
|
|
|
| ^^^^^ method not found in `Box<dyn Foo>`
|
2020-02-19 01:53:25 +00:00
|
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
::: $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
2020-02-19 01:53:25 +00:00
|
|
|
|
|
|
|
|
LL | pub struct Box<T: ?Sized>(Unique<T>);
|
2020-09-02 07:40:56 +00:00
|
|
|
| ------------------------------------- doesn't satisfy `Box<dyn Foo>: Clone`
|
2020-03-17 15:45:02 +00:00
|
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
::: $SRC_DIR/core/src/clone.rs:LL:COL
|
2020-03-17 15:45:02 +00:00
|
|
|
|
|
|
|
|
LL | fn clone(&self) -> Self;
|
|
|
|
| -----
|
|
|
|
| |
|
2020-09-02 07:40:56 +00:00
|
|
|
| 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
|
|
|
|
|
2020-02-19 00:35:47 +00:00
|
|
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
|
2020-09-02 07:40:56 +00:00
|
|
|
`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`.
|