about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/crashes/ice-12585.rs
blob: f35e95c6bc342e2b3fe119c9d3cccb31d07e936e (plain)
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());
}