libsyntax: Implement deriving correctly for type-parameterized structs and enums. r=brson
This commit is contained in:
parent
57588edf3b
commit
e6d87a3ef4
3 changed files with 168 additions and 61 deletions
17
src/test/run-pass/deriving-via-extension-type-params.rs
Normal file
17
src/test/run-pass/deriving-via-extension-type-params.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#[deriving_eq]
|
||||
#[deriving_iter_bytes]
|
||||
struct Foo<T> {
|
||||
x: int,
|
||||
y: T,
|
||||
z: int
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let a = Foo { x: 1, y: 2.0, z: 3 };
|
||||
let b = Foo { x: 1, y: 2.0, z: 3 };
|
||||
assert a == b;
|
||||
assert !(a != b);
|
||||
assert a.eq(&b);
|
||||
assert !a.ne(&b);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue