// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that if there is one impl we can infer everything. use std::mem; trait Convert { fn convert(&self) -> Target; } impl Convert for i16 { fn convert(&self) -> u32 { *self as u32 } } fn test(_: T, _: U, t_size: uint, u_size: uint) where T : Convert { assert_eq!(mem::size_of::(), t_size); assert_eq!(mem::size_of::(), u_size); } fn main() { // T = i16, U = u32 test(22, 44, 2, 4); }