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