Closed
Description
fn works<T>(x: T) -> ~[T] {
~[x]
}
fn doesnt<T: Clone>(x: T) -> ~[T] {
~[x]
}
fn main() {
let _: ~[uint] = works(0); // this is ok.
let _: ~[uint] = doesnt(0);
}
vec-infer.rs:11:21: 11:35 error: mismatched types: expected `~[uint]` but found `~[int]` (expected u but found )
vec-infer.rs:11 let _: ~[uint] = doesnt(0);
^~~~~~~~~~
error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:101
task '<main>' failed at 'explicit failure', /home/huon/rust/src/librustc/lib.rs:400