Support generic type
This commit is contained in:
parent
16e53c9868
commit
8cb2ec804d
9 changed files with 43 additions and 17 deletions
|
|
@ -13,4 +13,11 @@ fn main() {
|
|||
assert!(1 == 2);
|
||||
assert!(Debug(1) == Debug(2));
|
||||
assert!(NonDebug(1) == NonDebug(1)); // ok
|
||||
|
||||
test_generic(1, 2, 3, 4);
|
||||
}
|
||||
|
||||
fn test_generic<T: std::fmt::Debug + Eq, U: Eq>(x: T, y: T, z: U, w: U) {
|
||||
assert!(x == y);
|
||||
assert!(z == w); // ok
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue