2 // Test that we are able to infer that the type of `x` is `isize` based
3 // on the expected type from the object.
5 // pretty-expanded FIXME #23616
7 pub trait ToPrimitive {
11 impl ToPrimitive for isize {}
12 impl ToPrimitive for i32 {}
13 impl ToPrimitive for usize {}
15 fn doit<T>(val: T, f: &dyn Fn(T)) { f(val) }
18 doit(0, &|x /*: isize*/ | { x.to_int(); });