diff --git a/rust/cpp.rs b/rust/cpp.rs index 2090a662f9ec..1d0fbe10c4c8 100644 --- a/rust/cpp.rs +++ b/rust/cpp.rs @@ -229,9 +229,6 @@ impl<'msg, T: ?Sized> RepeatedField<'msg, T> { } } -// These use manual impls instead of derives to avoid unnecessary bounds on `T`. -// This problem is referred to as "perfect derive". -// https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/ impl<'msg, T: ?Sized> Copy for RepeatedField<'msg, T> {} impl<'msg, T: ?Sized> Clone for RepeatedField<'msg, T> { fn clone(&self) -> RepeatedField<'msg, T> { diff --git a/rust/shared.rs b/rust/shared.rs index f94f987989da..620d285061da 100644 --- a/rust/shared.rs +++ b/rust/shared.rs @@ -13,6 +13,11 @@ use std::fmt; +// There are a number of manual `Debug` and similar impls instead of using their +// derives, in order to to avoid unnecessary bounds on a generic `T`. +// This problem is referred to as "perfect derive". +// https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/ + /// Everything in `__public` is re-exported in `protobuf.rs`. /// These are the items protobuf users can access directly. #[doc(hidden)]