]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/privacy-struct-ctor.stderr
Shorten def_span for more items.
[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 note: tuple struct `m::S` exists but is inaccessible
37   --> $DIR/privacy-struct-ctor.rs:6:5
38    |
39 LL |     pub struct S(u8);
40    |     ^^^^^^^^^^^^^^^^^ not accessible
41
42 error[E0603]: tuple struct constructor `Z` is private
43   --> $DIR/privacy-struct-ctor.rs:18:12
44    |
45 LL |         pub(in m) struct Z(pub(in m::n) u8);
46    |                            --------------- a constructor is private if any of the fields is private
47 ...
48 LL |         n::Z;
49    |            ^ private tuple struct constructor
50    |
51 note: the tuple struct constructor `Z` is defined here
52   --> $DIR/privacy-struct-ctor.rs:12:9
53    |
54 LL |         pub(in m) struct Z(pub(in m::n) u8);
55    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57 error[E0603]: tuple struct constructor `S` is private
58   --> $DIR/privacy-struct-ctor.rs:29:8
59    |
60 LL |     pub struct S(u8);
61    |                  -- a constructor is private if any of the fields is private
62 ...
63 LL |     m::S;
64    |        ^ private tuple struct constructor
65    |
66 note: the tuple struct constructor `S` is defined here
67   --> $DIR/privacy-struct-ctor.rs:6:5
68    |
69 LL |     pub struct S(u8);
70    |     ^^^^^^^^^^^^^^^^^
71
72 error[E0603]: tuple struct constructor `S` is private
73   --> $DIR/privacy-struct-ctor.rs:31:19
74    |
75 LL |     pub struct S(u8);
76    |                  -- a constructor is private if any of the fields is private
77 ...
78 LL |     let _: S = m::S(2);
79    |                   ^ private tuple struct constructor
80    |
81 note: the tuple struct constructor `S` is defined here
82   --> $DIR/privacy-struct-ctor.rs:6:5
83    |
84 LL |     pub struct S(u8);
85    |     ^^^^^^^^^^^^^^^^^
86
87 error[E0603]: tuple struct constructor `Z` is private
88   --> $DIR/privacy-struct-ctor.rs:35:11
89    |
90 LL |         pub(in m) struct Z(pub(in m::n) u8);
91    |                            --------------- a constructor is private if any of the fields is private
92 ...
93 LL |     m::n::Z;
94    |           ^ private tuple struct constructor
95    |
96 note: the tuple struct constructor `Z` is defined here
97   --> $DIR/privacy-struct-ctor.rs:12:9
98    |
99 LL |         pub(in m) struct Z(pub(in m::n) u8);
100    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101
102 error[E0603]: tuple struct constructor `S` is private
103   --> $DIR/privacy-struct-ctor.rs:41:16
104    |
105 LL |     xcrate::m::S;
106    |                ^ private tuple struct constructor
107    |
108   ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
109    |
110 LL |     pub struct S(u8);
111    |                  -- a constructor is private if any of the fields is private
112    |
113 note: the tuple struct constructor `S` is defined here
114   --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
115    |
116 LL |     pub struct S(u8);
117    |     ^^^^^^^^^^^^
118
119 error[E0603]: tuple struct constructor `Z` is private
120   --> $DIR/privacy-struct-ctor.rs:45:19
121    |
122 LL |     xcrate::m::n::Z;
123    |                   ^ private tuple struct constructor
124    |
125   ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
126    |
127 LL |         pub(in m) struct Z(pub(in m::n) u8);
128    |                            --------------- a constructor is private if any of the fields is private
129    |
130 note: the tuple struct constructor `Z` is defined here
131   --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
132    |
133 LL |         pub(in m) struct Z(pub(in m::n) u8);
134    |         ^^^^^^^^^^^^^^^^^^
135
136 error: aborting due to 10 previous errors
137
138 Some errors have detailed explanations: E0423, E0603.
139 For more information about an error, try `rustc --explain E0423`.