Hi, I've got a code like this:
#[derive(Debug, Derivative, Zeroable)]
#[derivative(Default(bound = "T: Default"))]
pub struct LinkedCellArray<T, const N: usize = 32> {
size: Cell<usize>,
first_segment: ZeroableOption<Box<Segment<T, N>>>,
}
And deriving Zeroable adds T: Zeroable bound. This is bad, as I've got impl<T> Zeroable for ZeroableOption<T> {} for any T implemented. Doing manual impl<T, N> Zeroable for LinkedCellArray<T, const N> {} is also bad, as it does not check the soundness when the code is changed. Would it be possible to add an option to Zeroable to provide a custom bound, something like the following? :)
#[derive(Debug, Derivative, Zeroable)]
#[derivative(Default(bound = "T: Default"))]
#[zeroable(bound = "")]
pub struct LinkedCellArray<T, const N: usize = 32> {
size: Cell<usize>,
first_segment: ZeroableOption<Box<Segment<T, N>>>,
}
Hi, I've got a code like this:
And deriving
ZeroableaddsT: Zeroablebound. This is bad, as I've gotimpl<T> Zeroable for ZeroableOption<T> {}for anyTimplemented. Doing manualimpl<T, N> Zeroable for LinkedCellArray<T, const N> {}is also bad, as it does not check the soundness when the code is changed. Would it be possible to add an option toZeroableto provide a custom bound, something like the following? :)