How can I compare generic structs if the type parameter T implements PartialEq? I tried the following, but it doesn't compile. I understand I can just make Foobar<T> derive Eq and so on, but is it possible to have Foobar "inherit" or take the PartialEq from T somehow? I'm guessing something like that is already made for Vec, e.g. you can compare Vecs if and only if T implements PartialEq.
struct Foobar<T> {
foobar: T
}
fn x() -> bool {
let a = Foobar{foobar: 1};
let b = Foobar{foobar: 2};
a == b
}