]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unique-object-noncopyable.stderr
1c5fed2c33b4d56ce6f03bb4e5b33bd5944253c7
[rust.git] / src / test / ui / unique-object-noncopyable.stderr
1 error[E0599]: no method named `clone` found for struct `std::boxed::Box<dyn Foo>` in the current scope
2   --> $DIR/unique-object-noncopyable.rs:24:16
3    |
4 LL | trait Foo {
5    | ---------
6    | |
7    | doesn't satisfy `dyn Foo: std::clone::Clone`
8    | doesn't satisfy `dyn Foo: std::marker::Sized`
9 ...
10 LL |     let _z = y.clone();
11    |                ^^^^^ method not found in `std::boxed::Box<dyn Foo>`
12    | 
13   ::: $SRC_DIR/liballoc/boxed.rs:LL:COL
14    |
15 LL | pub struct Box<T: ?Sized>(Unique<T>);
16    | ------------------------------------- doesn't satisfy `std::boxed::Box<dyn Foo>: std::clone::Clone`
17    |
18    = note: the method `clone` exists but the following trait bounds were not satisfied:
19            `dyn Foo: std::marker::Sized`
20            which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
21            `dyn Foo: std::clone::Clone`
22            which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
23    = help: items from traits can only be used if the trait is implemented and in scope
24    = note: the following trait defines an item `clone`, perhaps you need to implement it:
25            candidate #1: `std::clone::Clone`
26
27 error: aborting due to previous error
28
29 For more information about this error, try `rustc --explain E0599`.