|
|
|
|
|
by enricozb
344 days ago
|
|
For structs, why couldn't rust check the necessary bounds on `T` for each field to be cloned? E.g. in #[derive(Clone)]
struct Weird<T> {
ptr: Arc<T>,
tup: (T, usize)
}
for `ptr`, `Arc<T>: Clone` exists with no bound on `T`. But for `tup`, `(T, usize): Clone` requires `T: Clone`.Same thing for other derives, such as `Default`. |
|