Created
May 21, 2014 00:54
-
-
Save bstrie/7543d83e817d988d76a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Foo<T> { | |
x: i16, | |
y: T | |
} | |
fn bar<T>(foo: Foo<T>) -> i16 { | |
foo.x | |
} | |
fn main() { | |
let foo1 = Foo { x: 0i16, y: 0i32 }; | |
let foo2 = Foo { x: 0i16, y: 0i8 }; | |
bar(foo1); | |
bar(foo2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment