better error message on failed derive (#1491)

Before, when deriving `SystemLabel` for a type without `Clone`, the error message was:
```
the trait `SystemLabel` is not implemented for `&TransformSystem`
```
Now it is
```
the trait `Clone` is not implemented for `TransformSystem`
```
which directly shows what's needed to fix the problem.
This commit is contained in:
Jakob Hellermann 2021-02-22 03:23:57 +00:00
parent 3319195f90
commit f73c6d18ef

View file

@ -503,7 +503,7 @@ fn derive_label(input: DeriveInput, label_type: Ident) -> TokenStream2 {
quote! {
impl #crate_path::#label_type for #ident {
fn dyn_clone(&self) -> Box<dyn #crate_path::#label_type> {
Box::new(self.clone())
Box::new(Clone::clone(self))
}
}
}