2017-01-29 02:56:52 +03:00
|
|
|
error[E0423]: expected value, found struct `Z`
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:20:9
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2019-10-14 17:20:50 -07:00
|
|
|
LL | pub struct S(u8);
|
|
|
|
| ----------------- similarly named tuple struct `S` defined here
|
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | Z;
|
2017-01-29 02:56:52 +03:00
|
|
|
| ^
|
2019-02-11 19:29:10 +01:00
|
|
|
| |
|
|
|
|
| constructor is not visible here due to private fields
|
|
|
|
| help: a tuple struct with a similar name exists: `S`
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
|
|
error[E0423]: expected value, found struct `S`
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:33:5
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | S;
|
2017-12-31 16:35:52 -08:00
|
|
|
| ^ constructor is not visible here due to private fields
|
2018-01-01 15:29:50 -08:00
|
|
|
|
|
|
|
error[E0423]: expected value, found struct `S2`
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:38:5
|
2017-07-05 16:39:06 -07:00
|
|
|
|
|
2019-09-22 11:27:55 -07:00
|
|
|
LL | / pub struct S2 {
|
|
|
|
LL | | s: u8
|
|
|
|
LL | | }
|
|
|
|
| |_____- `S2` defined here
|
|
|
|
...
|
|
|
|
LL | S2;
|
2020-07-09 17:42:07 -07:00
|
|
|
| ^^ help: use struct literal syntax instead: `S2 { s: val }`
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
|
|
error[E0423]: expected value, found struct `xcrate::S`
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:43:5
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | xcrate::S;
|
2017-12-31 16:35:52 -08:00
|
|
|
| ^^^^^^^^^ constructor is not visible here due to private fields
|
2019-10-23 22:20:58 -07:00
|
|
|
|
|
2021-09-18 00:07:41 +02:00
|
|
|
note: tuple struct `m::S` exists but is inaccessible
|
|
|
|
--> $DIR/privacy-struct-ctor.rs:6:5
|
|
|
|
|
|
|
|
|
LL | pub struct S(u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^ not accessible
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `Z` is private
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:18:12
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub(in m) struct Z(pub(in m::n) u8);
|
2019-10-11 22:00:15 +03:00
|
|
|
| --------------- a constructor is private if any of the fields is private
|
2019-10-09 17:37:48 +03:00
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | n::Z;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^ private tuple struct constructor
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `Z` is defined here
|
|
|
|
--> $DIR/privacy-struct-ctor.rs:12:9
|
|
|
|
|
|
|
|
|
LL | pub(in m) struct Z(pub(in m::n) u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2023-01-10 20:57:02 +00:00
|
|
|
help: consider making the field publicly accessible
|
|
|
|
|
|
|
|
|
LL | pub(in m) struct Z(pub u8);
|
|
|
|
| ~~~
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `S` is private
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:29:8
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub struct S(u8);
|
2019-10-11 22:00:15 +03:00
|
|
|
| -- a constructor is private if any of the fields is private
|
2019-10-09 17:37:48 +03:00
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | m::S;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^ private tuple struct constructor
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `S` is defined here
|
|
|
|
--> $DIR/privacy-struct-ctor.rs:6:5
|
|
|
|
|
|
|
|
|
LL | pub struct S(u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
2023-01-10 20:57:02 +00:00
|
|
|
help: consider making the field publicly accessible
|
|
|
|
|
|
|
|
|
LL | pub struct S(pub u8);
|
|
|
|
| +++
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `S` is private
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:31:19
|
2018-01-15 05:18:06 -08:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub struct S(u8);
|
2019-10-11 22:00:15 +03:00
|
|
|
| -- a constructor is private if any of the fields is private
|
2019-10-09 17:37:48 +03:00
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _: S = m::S(2);
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^ private tuple struct constructor
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `S` is defined here
|
|
|
|
--> $DIR/privacy-struct-ctor.rs:6:5
|
|
|
|
|
|
|
|
|
LL | pub struct S(u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
2023-01-10 20:57:02 +00:00
|
|
|
help: consider making the field publicly accessible
|
|
|
|
|
|
|
|
|
LL | pub struct S(pub u8);
|
|
|
|
| +++
|
2018-01-15 05:18:06 -08:00
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `Z` is private
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:35:11
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub(in m) struct Z(pub(in m::n) u8);
|
2019-10-11 22:00:15 +03:00
|
|
|
| --------------- a constructor is private if any of the fields is private
|
2019-10-09 17:37:48 +03:00
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | m::n::Z;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^ private tuple struct constructor
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `Z` is defined here
|
|
|
|
--> $DIR/privacy-struct-ctor.rs:12:9
|
|
|
|
|
|
|
|
|
LL | pub(in m) struct Z(pub(in m::n) u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2023-01-10 20:57:02 +00:00
|
|
|
help: consider making the field publicly accessible
|
|
|
|
|
|
|
|
|
LL | pub(in m) struct Z(pub u8);
|
|
|
|
| ~~~
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `S` is private
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:41:16
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | xcrate::m::S;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^ private tuple struct constructor
|
2021-06-10 13:52:00 +02:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
|
2019-08-09 12:52:02 -07:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub struct S(u8);
|
2019-10-11 22:00:15 +03:00
|
|
|
| -- a constructor is private if any of the fields is private
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `S` is defined here
|
|
|
|
--> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
|
|
|
|
|
|
|
|
|
LL | pub struct S(u8);
|
2022-02-13 16:27:59 +01:00
|
|
|
| ^^^^^^^^^^^^
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `Z` is private
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/privacy-struct-ctor.rs:45:19
|
2017-01-29 02:56:52 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | xcrate::m::n::Z;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^ private tuple struct constructor
|
2021-06-10 13:52:00 +02:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
|
2019-08-09 12:52:02 -07:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub(in m) struct Z(pub(in m::n) u8);
|
2019-10-11 22:00:15 +03:00
|
|
|
| --------------- a constructor is private if any of the fields is private
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `Z` is defined here
|
|
|
|
--> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
|
|
|
|
|
|
|
|
|
LL | pub(in m) struct Z(pub(in m::n) u8);
|
2022-02-13 16:27:59 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2018-01-15 05:18:06 -08:00
|
|
|
error: aborting due to 10 previous errors
|
2017-01-29 02:56:52 +03:00
|
|
|
|
2019-04-17 13:26:38 -04:00
|
|
|
Some errors have detailed explanations: E0423, E0603.
|
2018-03-03 15:59:40 +01:00
|
|
|
For more information about an error, try `rustc --explain E0423`.
|