1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
//@ check-pass #![allow(clippy::unit_arg)] struct One { x: i32, } struct Two { x: i32, } struct Product {} impl Product { pub fn a_method(self, _: ()) {} } fn from_array(_: [i32; 2]) -> Product { todo!() } pub fn main() { let one = One { x: 1 }; let two = Two { x: 2 }; let product = from_array([one.x, two.x]); product.a_method(<()>::default()); }