PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/test/run-pass/generic-fn-infer.rs

http://github.com/jruderman/rust
Rust | 9 lines | 2 code | 5 blank | 2 comment | 1 complexity | 3991ce9f4cab6d2fde1d2666d8cf37ad MD5 | raw file
1
2
3
4// -*- rust -*-
5
6// Issue #45: infer type parameters in function applications
7fn id<T: copy>(x: T) -> T { return x; }
8
9fn main() { let x: int = 42; let y: int = id(x); assert (x == y); }