]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/suggest-making-field-public.stderr
Auto merge of #106780 - flip1995:clippyup, r=Manishearth
[rust.git] / tests / ui / privacy / suggest-making-field-public.stderr
1 error[E0603]: tuple struct constructor `A` is private
2   --> $DIR/suggest-making-field-public.rs:13:8
3    |
4 LL |     pub struct A(pub(self)String);
5    |                  --------------- a constructor is private if any of the fields is private
6 ...
7 LL |     a::A("a".into());
8    |        ^ private tuple struct constructor
9    |
10 note: the tuple struct constructor `A` is defined here
11   --> $DIR/suggest-making-field-public.rs:3:5
12    |
13 LL |     pub struct A(pub(self)String);
14    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 help: consider making the field publicly accessible
16    |
17 LL |     pub struct A(pub String);
18    |                  ~~~
19
20 error[E0423]: cannot initialize a tuple struct which contains private fields
21   --> $DIR/suggest-making-field-public.rs:9:9
22    |
23 LL |         A("".into());
24    |         ^
25    |
26 note: constructor is not visible here due to private fields
27   --> $DIR/suggest-making-field-public.rs:3:18
28    |
29 LL |     pub struct A(pub(self)String);
30    |                  ^^^^^^^^^^^^^^^ private field
31 help: consider making the field publicly accessible
32    |
33 LL |     pub struct A(pub String);
34    |                  ~~~
35
36 error: aborting due to 2 previous errors
37
38 Some errors have detailed explanations: E0423, E0603.
39 For more information about an error, try `rustc --explain E0423`.