]> git.proxmox.com Git - rustc.git/blame - tests/ui/resolve/privacy-struct-ctor.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / resolve / privacy-struct-ctor.stderr
CommitLineData
8bb4bdeb 1error[E0423]: expected value, found struct `Z`
0731742a 2 --> $DIR/privacy-struct-ctor.rs:20:9
8bb4bdeb 3 |
e74abb32
XL
4LL | pub struct S(u8);
5 | ----------------- similarly named tuple struct `S` defined here
6...
0531ce1d 7LL | Z;
8bb4bdeb 8 | ^
9fa01778
XL
9 | |
10 | constructor is not visible here due to private fields
11 | help: a tuple struct with a similar name exists: `S`
8bb4bdeb
XL
12
13error[E0423]: expected value, found struct `S`
0731742a 14 --> $DIR/privacy-struct-ctor.rs:33:5
8bb4bdeb 15 |
0531ce1d 16LL | S;
2c00a5a8 17 | ^ constructor is not visible here due to private fields
8bb4bdeb 18
2c00a5a8 19error[E0423]: expected value, found struct `S2`
0731742a 20 --> $DIR/privacy-struct-ctor.rs:38:5
2c00a5a8 21 |
e74abb32
XL
22LL | / pub struct S2 {
23LL | | s: u8
24LL | | }
25 | |_____- `S2` defined here
26...
27LL | S2;
3dfed10e 28 | ^^ help: use struct literal syntax instead: `S2 { s: val }`
2c00a5a8 29
8bb4bdeb 30error[E0423]: expected value, found struct `xcrate::S`
0731742a 31 --> $DIR/privacy-struct-ctor.rs:43:5
8bb4bdeb 32 |
0531ce1d 33LL | xcrate::S;
2c00a5a8 34 | ^^^^^^^^^ constructor is not visible here due to private fields
e74abb32 35 |
c295e0f8
XL
36note: tuple struct `m::S` exists but is inaccessible
37 --> $DIR/privacy-struct-ctor.rs:6:5
041b39d2 38 |
c295e0f8
XL
39LL | pub struct S(u8);
40 | ^^^^^^^^^^^^^^^^^ not accessible
8bb4bdeb 41
e74abb32 42error[E0603]: tuple struct constructor `Z` is private
0731742a 43 --> $DIR/privacy-struct-ctor.rs:18:12
8bb4bdeb 44 |
e74abb32
XL
45LL | pub(in m) struct Z(pub(in m::n) u8);
46 | --------------- a constructor is private if any of the fields is private
47...
0531ce1d 48LL | n::Z;
ba9703b0 49 | ^ private tuple struct constructor
dfeec247
XL
50 |
51note: the tuple struct constructor `Z` is defined here
52 --> $DIR/privacy-struct-ctor.rs:12:9
53 |
54LL | pub(in m) struct Z(pub(in m::n) u8);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9c376795
FG
56help: consider making the field publicly accessible
57 |
58LL | pub(in m) struct Z(pub u8);
59 | ~~~
8bb4bdeb 60
e74abb32 61error[E0603]: tuple struct constructor `S` is private
0731742a 62 --> $DIR/privacy-struct-ctor.rs:29:8
8bb4bdeb 63 |
e74abb32
XL
64LL | pub struct S(u8);
65 | -- a constructor is private if any of the fields is private
66...
0531ce1d 67LL | m::S;
ba9703b0 68 | ^ private tuple struct constructor
dfeec247
XL
69 |
70note: the tuple struct constructor `S` is defined here
71 --> $DIR/privacy-struct-ctor.rs:6:5
72 |
73LL | pub struct S(u8);
74 | ^^^^^^^^^^^^^^^^^
9c376795
FG
75help: consider making the field publicly accessible
76 |
77LL | pub struct S(pub u8);
78 | +++
8bb4bdeb 79
e74abb32 80error[E0603]: tuple struct constructor `S` is private
0731742a 81 --> $DIR/privacy-struct-ctor.rs:31:19
2c00a5a8 82 |
e74abb32
XL
83LL | pub struct S(u8);
84 | -- a constructor is private if any of the fields is private
85...
0531ce1d 86LL | let _: S = m::S(2);
ba9703b0 87 | ^ private tuple struct constructor
dfeec247
XL
88 |
89note: the tuple struct constructor `S` is defined here
90 --> $DIR/privacy-struct-ctor.rs:6:5
91 |
92LL | pub struct S(u8);
93 | ^^^^^^^^^^^^^^^^^
9c376795
FG
94help: consider making the field publicly accessible
95 |
96LL | pub struct S(pub u8);
97 | +++
2c00a5a8 98
e74abb32 99error[E0603]: tuple struct constructor `Z` is private
0731742a 100 --> $DIR/privacy-struct-ctor.rs:35:11
8bb4bdeb 101 |
e74abb32
XL
102LL | pub(in m) struct Z(pub(in m::n) u8);
103 | --------------- a constructor is private if any of the fields is private
104...
0531ce1d 105LL | m::n::Z;
ba9703b0 106 | ^ private tuple struct constructor
dfeec247
XL
107 |
108note: the tuple struct constructor `Z` is defined here
109 --> $DIR/privacy-struct-ctor.rs:12:9
110 |
111LL | pub(in m) struct Z(pub(in m::n) u8);
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9c376795
FG
113help: consider making the field publicly accessible
114 |
115LL | pub(in m) struct Z(pub u8);
116 | ~~~
8bb4bdeb 117
e74abb32 118error[E0603]: tuple struct constructor `S` is private
0731742a 119 --> $DIR/privacy-struct-ctor.rs:41:16
8bb4bdeb 120 |
0531ce1d 121LL | xcrate::m::S;
ba9703b0 122 | ^ private tuple struct constructor
94222f64 123 |
e74abb32 124 ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
416331ca 125 |
e74abb32
XL
126LL | pub struct S(u8);
127 | -- a constructor is private if any of the fields is private
dfeec247
XL
128 |
129note: the tuple struct constructor `S` is defined here
130 --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
131 |
132LL | pub struct S(u8);
064997fb 133 | ^^^^^^^^^^^^
8bb4bdeb 134
e74abb32 135error[E0603]: tuple struct constructor `Z` is private
0731742a 136 --> $DIR/privacy-struct-ctor.rs:45:19
8bb4bdeb 137 |
0531ce1d 138LL | xcrate::m::n::Z;
ba9703b0 139 | ^ private tuple struct constructor
94222f64 140 |
e74abb32 141 ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
416331ca 142 |
e74abb32
XL
143LL | pub(in m) struct Z(pub(in m::n) u8);
144 | --------------- a constructor is private if any of the fields is private
dfeec247
XL
145 |
146note: the tuple struct constructor `Z` is defined here
147 --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
148 |
149LL | pub(in m) struct Z(pub(in m::n) u8);
064997fb 150 | ^^^^^^^^^^^^^^^^^^
8bb4bdeb 151
2c00a5a8 152error: aborting due to 10 previous errors
8bb4bdeb 153
48663c56 154Some errors have detailed explanations: E0423, E0603.
0531ce1d 155For more information about an error, try `rustc --explain E0423`.