Deriving a trait results in unexpected compiler error, but the manual implementation works
问题 This code (playground): #[derive(Clone)] struct Foo<\'a, T: \'a> { t: &\'a T, } fn bar<\'a, T>(foo: Foo<\'a, T>) { foo.clone(); } ... does not compile: error: no method named `clone` found for type `Foo<\'a, T>` in the current scope --> <anon>:7:9 |> 16 |> foo.clone(); |> ^^^^^ note: the method `clone` exists but the following trait bounds were not satisfied: `T : std::clone::Clone` help: items from traits can only be used if the trait is implemented and in scope; the following trait defines