rust/src/test/ui/resolve/privacy-struct-ctor.stderr

139 lines
4.3 KiB
Plaintext
Raw Normal View History

error[E0423]: expected value, found struct `Z`
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:20:9
|
LL | pub struct S(u8);
| ----------------- similarly named tuple struct `S` defined here
...
2018-02-22 18:42:32 -06:00
LL | Z;
| ^
| |
| constructor is not visible here due to private fields
| help: a tuple struct with a similar name exists: `S`
error[E0423]: expected value, found struct `S`
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:33:5
|
2018-02-22 18:42:32 -06:00
LL | S;
| ^ constructor is not visible here due to private fields
error[E0423]: expected value, found struct `S2`
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:38:5
|
LL | / pub struct S2 {
LL | | s: u8
LL | | }
| |_____- `S2` defined here
...
LL | S2;
| ^^ did you mean `S2 { /* fields */ }`?
error[E0423]: expected value, found struct `xcrate::S`
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:43:5
|
2018-02-22 18:42:32 -06:00
LL | xcrate::S;
| ^^^^^^^^^ constructor is not visible here due to private fields
|
2017-05-10 06:19:29 -05:00
help: possible better candidate is found in another module, you can import it into scope
2017-06-28 01:16:04 -05:00
|
2018-02-24 17:01:39 -06:00
LL | use m::S;
|
error[E0603]: tuple struct constructor `Z` is private
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:18:12
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private
...
2018-02-22 18:42:32 -06:00
LL | n::Z;
| ^ this tuple struct constructor is private
|
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);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `S` is private
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:29:8
|
LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private
...
2018-02-22 18:42:32 -06:00
LL | m::S;
| ^ this tuple struct constructor is private
|
note: the tuple struct constructor `S` is defined here
--> $DIR/privacy-struct-ctor.rs:6:5
|
LL | pub struct S(u8);
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `S` is private
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:31:19
|
LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private
...
2018-02-22 18:42:32 -06:00
LL | let _: S = m::S(2);
| ^ this tuple struct constructor is private
|
note: the tuple struct constructor `S` is defined here
--> $DIR/privacy-struct-ctor.rs:6:5
|
LL | pub struct S(u8);
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `Z` is private
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:35:11
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private
...
2018-02-22 18:42:32 -06:00
LL | m::n::Z;
| ^ this tuple struct constructor is private
|
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);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `S` is private
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:41:16
|
2018-02-22 18:42:32 -06:00
LL | xcrate::m::S;
| ^ this tuple struct constructor is private
|
::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
|
LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `S` is defined here
--> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
|
LL | pub struct S(u8);
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `Z` is private
2018-12-25 09:56:47 -06:00
--> $DIR/privacy-struct-ctor.rs:45:19
|
2018-02-22 18:42:32 -06:00
LL | xcrate::m::n::Z;
| ^ this tuple struct constructor is private
|
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private
|
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);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 10 previous errors
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`.