35 lines
1.5 KiB
Plaintext
35 lines
1.5 KiB
Plaintext
error[E0038]: the trait `Clone` cannot be made into an object
|
|
--> $DIR/issue-116434-2021.rs:5:17
|
|
|
|
|
LL | fn foo() -> 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 "dyn-compatible" 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>
|
|
help: there is an associated type with the same name
|
|
|
|
|
LL | fn foo() -> Self::Clone;
|
|
| ++++++
|
|
|
|
error[E0038]: the trait `DbHandle` cannot be made into an object
|
|
--> $DIR/issue-116434-2021.rs:14:20
|
|
|
|
|
LL | fn handle() -> DbHandle;
|
|
| ^^^^^^^^ `DbHandle` cannot be made into an object
|
|
|
|
|
note: for a trait to be "dyn-compatible" 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>
|
|
--> $DIR/issue-116434-2021.rs:10:17
|
|
|
|
|
LL | trait DbHandle: Sized {}
|
|
| -------- ^^^^^ ...because it requires `Self: Sized`
|
|
| |
|
|
| this trait cannot be made into an object...
|
|
help: there is an associated type with the same name
|
|
|
|
|
LL | fn handle() -> Self::DbHandle;
|
|
| ++++++
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0038`.
|