File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 11// Can't use unit struct as constructor function
2+ // related issue <https://github.com/rust-lang/rust/issues/20714>
23
34//@ aux-build:empty-struct.rs
45
@@ -8,7 +9,7 @@ use empty_struct::*;
89struct Empty2 ;
910
1011enum E {
11- Empty4
12+ Empty4 ,
1213}
1314
1415fn main ( ) {
Original file line number Diff line number Diff line change 11error[E0618]: expected function, found struct `Empty2`
2- --> $DIR/empty-struct-unit-expr.rs:15 :14
2+ --> $DIR/empty-struct-unit-expr.rs:16 :14
33 |
44LL | struct Empty2;
55 | ------------- struct `Empty2` defined here
@@ -16,9 +16,9 @@ LL + let e2 = Empty2;
1616 |
1717
1818error[E0618]: expected function, found enum variant `E::Empty4`
19- --> $DIR/empty-struct-unit-expr.rs:16 :14
19+ --> $DIR/empty-struct-unit-expr.rs:17 :14
2020 |
21- LL | Empty4
21+ LL | Empty4,
2222 | ------ enum variant `E::Empty4` defined here
2323...
2424LL | let e4 = E::Empty4();
@@ -33,7 +33,7 @@ LL + let e4 = E::Empty4;
3333 |
3434
3535error[E0618]: expected function, found struct `XEmpty2`
36- --> $DIR/empty-struct-unit-expr.rs:18 :15
36+ --> $DIR/empty-struct-unit-expr.rs:19 :15
3737 |
3838LL | let xe2 = XEmpty2();
3939 | ^^^^^^^--
@@ -47,7 +47,7 @@ LL + let xe2 = XEmpty2;
4747 |
4848
4949error[E0618]: expected function, found enum variant `XE::XEmpty4`
50- --> $DIR/empty-struct-unit-expr.rs:19 :15
50+ --> $DIR/empty-struct-unit-expr.rs:20 :15
5151 |
5252LL | let xe4 = XE::XEmpty4();
5353 | ^^^^^^^^^^^--
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments