// run-rustfix // The `try_into` suggestion doesn't include this, but we do suggest it after applying it use std::convert::TryInto; fn foo(_x: N) {} fn main() { let x_usize: usize = 1; let x_u64: u64 = 2; let x_u32: u32 = 3; let x_u16: u16 = 4; let x_u8: u8 = 5; let x_isize: isize = 6; let x_i64: i64 = 7; let x_i32: i32 = 8; let x_i16: i16 = 9; let x_i8: i8 = 10; let x_f64: f64 = 11.0; let x_f32: f32 = 12.0; foo::(x_usize); foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); // foo::(x_f64); // foo::(x_f32); foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types foo::(x_f64); foo::(x_f32); //~^ ERROR mismatched types foo::(x_usize); //~^ ERROR mismatched types foo::(x_u64); //~^ ERROR mismatched types foo::(x_u32); //~^ ERROR mismatched types foo::(x_u16); //~^ ERROR mismatched types foo::(x_u8); //~^ ERROR mismatched types foo::(x_isize); //~^ ERROR mismatched types foo::(x_i64); //~^ ERROR mismatched types foo::(x_i32); //~^ ERROR mismatched types foo::(x_i16); //~^ ERROR mismatched types foo::(x_i8); //~^ ERROR mismatched types // foo::(x_f64); foo::(x_f32); foo::(x_u8 as u16); //~^ ERROR mismatched types foo::(-x_i8); //~^ ERROR mismatched types }