--> src/main.rs:45:10
|
45 | #[derive(Derivative)]
| ^^^^^^^^^^ expected `&String`, found struct `String`
|
= note: this error originates in the derive macro `Derivative` (in Nightly builds, run with -Z macro-backtrace for more info)
Expected behavior
Here's what current version of macro expands to:
impl<'a> Clone for MyStruct<'a> {
fn clone(&self) -> Self {
Self {
borrowed: self.borrowed, // instead of the default, which is: `self.borrowed.clone()`
}
}
}
Describe the bug Current
#[derivative(Clone)]
does not work on struct with specific lifetimeTo Reproduce
will give:
Expected behavior Here's what current version of macro expands to:
what we need:
Thanks!