PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/generic-type.rs

http://github.com/jruderman/rust
Rust | 9 lines | 6 code | 3 blank | 0 comment | 2 complexity | 96f5a1afcf14b6581f835087490789ee MD5 | raw file
1
2
3type pair<T> = {x: T, y: T};
4
5fn main() {
6    let x: pair<int> = {x: 10, y: 12};
7    assert (x.x == 10);
8    assert (x.y == 12);
9}