For example:
#[deriving(Clone)]
struct Filter<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
it: I,
p: P,
}
expands to:
impl<A: Clone, I: Clone, P: Clone> Clone for Filter<A, I, P> where /* .. */ { /* .. */ }
The A: Clone bound is incorrect. Instead deriving should expand to:
impl<A, I, P> Clone for Filter<A, I, P> where
I: Clone,
P: Clone,
/* .. */ { /* .. */ }
This requires generalized where clauses to handle more complex fields like &'a T: Clone.
@nikomatsakis Are where clauses like &'a int: Clone (note: no generic parameter) going to be allowed? If not, writing the syntax extension is going to be harder.
For example:
expands to:
The
A: Clonebound is incorrect. Insteadderivingshould expand to:This requires generalized
whereclauses to handle more complex fields like&'a T: Clone.@nikomatsakis Are where clauses like
&'a int: Clone(note: no generic parameter) going to be allowed? If not, writing the syntax extension is going to be harder.