blob: f1a1de4d9c0fd118520db027ab2d6a4676bed996 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
error[E0423]: expected value, found struct `Z`
--> $DIR/privacy-struct-ctor.rs:20:9
|
LL | pub struct S(u8);
| ----------------- similarly named tuple struct `S` defined here
...
LL | Z;
| ^
| |
| constructor is not visible here due to private fields
| help: a tuple struct with a similar name exists: `S`
error[E0423]: expected value, found struct `S`
--> $DIR/privacy-struct-ctor.rs:33:5
|
LL | S;
| ^ constructor is not visible here due to private fields
error[E0423]: expected value, found struct `S2`
--> $DIR/privacy-struct-ctor.rs:38:5
|
LL | / pub struct S2 {
LL | | s: u8
LL | | }
| |_____- `S2` defined here
...
LL | S2;
| ^^ did you mean `S2 { /* fields */ }`?
error[E0423]: expected value, found struct `xcrate::S`
--> $DIR/privacy-struct-ctor.rs:43:5
|
LL | xcrate::S;
| ^^^^^^^^^ constructor is not visible here due to private fields
|
help: possible better candidate is found in another module, you can import it into scope
|
LL | use m::S;
|
error[E0603]: tuple struct constructor `Z` is private
--> $DIR/privacy-struct-ctor.rs:18:12
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private
...
LL | n::Z;
| ^
error[E0603]: tuple struct constructor `S` is private
--> $DIR/privacy-struct-ctor.rs:29:8
|
LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private
...
LL | m::S;
| ^
error[E0603]: tuple struct constructor `S` is private
--> $DIR/privacy-struct-ctor.rs:31:19
|
LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private
...
LL | let _: S = m::S(2);
| ^
error[E0603]: tuple struct constructor `Z` is private
--> $DIR/privacy-struct-ctor.rs:35:11
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private
...
LL | m::n::Z;
| ^
error[E0603]: tuple struct constructor `S` is private
--> $DIR/privacy-struct-ctor.rs:41:16
|
LL | xcrate::m::S;
| ^
|
::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
|
LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private
error[E0603]: tuple struct constructor `Z` is private
--> $DIR/privacy-struct-ctor.rs:45:19
|
LL | xcrate::m::n::Z;
| ^
|
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private
error: aborting due to 10 previous errors
Some errors have detailed explanations: E0423, E0603.
For more information about an error, try `rustc --explain E0423`.
|