about summary refs log tree commit diff
path: root/tests/ui/structs/struct-construct-with-call-issue-138931.rs
blob: 5d50eb14bff1a8d913373c3b35a47c5d31335b9c (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
struct PersonOnlyName {
    name: String
}

struct PersonWithAge {
    name: String,
    age: u8,
    height: u8,
}



fn main() {
    let wilfred = PersonOnlyName("Name1".to_owned());
    //~^ ERROR expected function, tuple struct or tuple variant, found struct `PersonOnlyName` [E0423]

    let bill = PersonWithAge( //~ ERROR expected function, tuple struct or tuple variant, found struct `PersonWithAge` [E0423]
        "Name2".to_owned(),
        20,
        180,
    );

    let person = PersonWithAge("Name3".to_owned());
    //~^ ERROR expected function, tuple struct or tuple variant, found struct `PersonWithAge` [E0423]
}