2 #![allow(non_camel_case_types)]
4 // Test that we pick which version of `foo` to run based on the
5 // type that is (ultimately) inferred for `x`.
12 impl foo for Vec<u32> {
13 fn foo(&self) -> i32 {1}
16 impl foo for Vec<i32> {
17 fn foo(&self) -> i32 {2}
20 fn call_foo_uint() -> i32 {
21 let mut x = Vec::new();
27 fn call_foo_int() -> i32 {
28 let mut x = Vec::new();
35 assert_eq!(call_foo_uint(), 1);
36 assert_eq!(call_foo_int(), 2);