]> git.lizzy.rs Git - rust.git/blob - src/test/ui/empty/empty-struct-unit-expr.rs
Be more precise when suggesting removal of parens on unit adt ctor
[rust.git] / src / test / ui / empty / empty-struct-unit-expr.rs
1 // Can't use unit struct as constructor function
2
3 // aux-build:empty-struct.rs
4
5 extern crate empty_struct;
6 use empty_struct::*;
7
8 struct Empty2;
9
10 enum E {
11     Empty4
12 }
13
14 fn main() {
15     let e2 = Empty2(); //~ ERROR expected function, found struct `Empty2`
16     let e4 = E::Empty4();
17     //~^ ERROR expected function, found enum variant `E::Empty4` [E0618]
18     let xe2 = XEmpty2(); //~ ERROR expected function, found struct `XEmpty2`
19     let xe4 = XE::XEmpty4();
20     //~^ ERROR expected function, found enum variant `XE::XEmpty4` [E0618]
21 }