]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/privacy-struct-ctor.stderr
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[rust.git] / src / test / ui / resolve / privacy-struct-ctor.stderr
1 error[E0423]: expected value, found struct `Z`
2   --> $DIR/privacy-struct-ctor.rs:20:9
3    |
4 LL |     pub struct S(u8);
5    |     ----------------- similarly named tuple struct `S` defined here
6 ...
7 LL |         Z;
8    |         ^
9    |         |
10    |         constructor is not visible here due to private fields
11    |         help: a tuple struct with a similar name exists: `S`
12
13 error[E0423]: expected value, found struct `S`
14   --> $DIR/privacy-struct-ctor.rs:33:5
15    |
16 LL |     S;
17    |     ^ constructor is not visible here due to private fields
18
19 error[E0423]: expected value, found struct `S2`
20   --> $DIR/privacy-struct-ctor.rs:38:5
21    |
22 LL | /     pub struct S2 {
23 LL | |         s: u8
24 LL | |     }
25    | |_____- `S2` defined here
26 ...
27 LL |       S2;
28    |       ^^ help: use struct literal syntax instead: `S2 { s: val }`
29
30 error[E0423]: expected value, found struct `xcrate::S`
31   --> $DIR/privacy-struct-ctor.rs:43:5
32    |
33 LL |     xcrate::S;
34    |     ^^^^^^^^^ constructor is not visible here due to private fields
35    |
36 help: consider importing this tuple struct instead
37    |
38 LL | use m::S;
39    |
40
41 error[E0603]: tuple struct constructor `Z` is private
42   --> $DIR/privacy-struct-ctor.rs:18:12
43    |
44 LL |         pub(in m) struct Z(pub(in m::n) u8);
45    |                            --------------- a constructor is private if any of the fields is private
46 ...
47 LL |         n::Z;
48    |            ^ private tuple struct constructor
49    |
50 note: the tuple struct constructor `Z` is defined here
51   --> $DIR/privacy-struct-ctor.rs:12:9
52    |
53 LL |         pub(in m) struct Z(pub(in m::n) u8);
54    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55
56 error[E0603]: tuple struct constructor `S` is private
57   --> $DIR/privacy-struct-ctor.rs:29:8
58    |
59 LL |     pub struct S(u8);
60    |                  -- a constructor is private if any of the fields is private
61 ...
62 LL |     m::S;
63    |        ^ private tuple struct constructor
64    |
65 note: the tuple struct constructor `S` is defined here
66   --> $DIR/privacy-struct-ctor.rs:6:5
67    |
68 LL |     pub struct S(u8);
69    |     ^^^^^^^^^^^^^^^^^
70
71 error[E0603]: tuple struct constructor `S` is private
72   --> $DIR/privacy-struct-ctor.rs:31:19
73    |
74 LL |     pub struct S(u8);
75    |                  -- a constructor is private if any of the fields is private
76 ...
77 LL |     let _: S = m::S(2);
78    |                   ^ private tuple struct constructor
79    |
80 note: the tuple struct constructor `S` is defined here
81   --> $DIR/privacy-struct-ctor.rs:6:5
82    |
83 LL |     pub struct S(u8);
84    |     ^^^^^^^^^^^^^^^^^
85
86 error[E0603]: tuple struct constructor `Z` is private
87   --> $DIR/privacy-struct-ctor.rs:35:11
88    |
89 LL |         pub(in m) struct Z(pub(in m::n) u8);
90    |                            --------------- a constructor is private if any of the fields is private
91 ...
92 LL |     m::n::Z;
93    |           ^ private tuple struct constructor
94    |
95 note: the tuple struct constructor `Z` is defined here
96   --> $DIR/privacy-struct-ctor.rs:12:9
97    |
98 LL |         pub(in m) struct Z(pub(in m::n) u8);
99    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101 error[E0603]: tuple struct constructor `S` is private
102   --> $DIR/privacy-struct-ctor.rs:41:16
103    |
104 LL |     xcrate::m::S;
105    |                ^ private tuple struct constructor
106    | 
107   ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
108    |
109 LL |     pub struct S(u8);
110    |                  -- a constructor is private if any of the fields is private
111    |
112 note: the tuple struct constructor `S` is defined here
113   --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
114    |
115 LL |     pub struct S(u8);
116    |     ^^^^^^^^^^^^^^^^^
117
118 error[E0603]: tuple struct constructor `Z` is private
119   --> $DIR/privacy-struct-ctor.rs:45:19
120    |
121 LL |     xcrate::m::n::Z;
122    |                   ^ private tuple struct constructor
123    | 
124   ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
125    |
126 LL |         pub(in m) struct Z(pub(in m::n) u8);
127    |                            --------------- a constructor is private if any of the fields is private
128    |
129 note: the tuple struct constructor `Z` is defined here
130   --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
131    |
132 LL |         pub(in m) struct Z(pub(in m::n) u8);
133    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134
135 error: aborting due to 10 previous errors
136
137 Some errors have detailed explanations: E0423, E0603.
138 For more information about an error, try `rustc --explain E0423`.