-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostics for inaccessible constructors
- Loading branch information
1 parent
c9788fd
commit d38a8ad
Showing
6 changed files
with
103 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
error[E0423]: expected value, found struct `Z` | ||
--> $DIR/privacy-struct-ctor.rs:28:9 | ||
| | ||
28 | Z; | ||
| ^ | ||
| | | ||
| did you mean `Z { /* fields */ }`? | ||
| constructor is not visible here due to private fields | ||
| | ||
= help: possible better candidate is found in another module, you can import it into scope: | ||
`use m::n::Z;` | ||
|
||
error[E0423]: expected value, found struct `S` | ||
--> $DIR/privacy-struct-ctor.rs:38:5 | ||
| | ||
38 | S; | ||
| ^ | ||
| | | ||
| did you mean `S { /* fields */ }`? | ||
| constructor is not visible here due to private fields | ||
| | ||
= help: possible better candidate is found in another module, you can import it into scope: | ||
`use m::S;` | ||
|
||
error[E0423]: expected value, found struct `xcrate::S` | ||
--> $DIR/privacy-struct-ctor.rs:44:5 | ||
| | ||
44 | xcrate::S; | ||
| ^^^^^^^^^ | ||
| | | ||
| did you mean `xcrate::S { /* fields */ }`? | ||
| constructor is not visible here due to private fields | ||
| | ||
= help: possible better candidate is found in another module, you can import it into scope: | ||
`use m::S;` | ||
|
||
error: tuple struct `Z` is private | ||
--> $DIR/privacy-struct-ctor.rs:27:9 | ||
| | ||
27 | n::Z; //~ ERROR tuple struct `Z` is private | ||
| ^^^^ | ||
|
||
error: tuple struct `S` is private | ||
--> $DIR/privacy-struct-ctor.rs:37:5 | ||
| | ||
37 | m::S; //~ ERROR tuple struct `S` is private | ||
| ^^^^ | ||
|
||
error: tuple struct `Z` is private | ||
--> $DIR/privacy-struct-ctor.rs:41:5 | ||
| | ||
41 | m::n::Z; //~ ERROR tuple struct `Z` is private | ||
| ^^^^^^^ | ||
|
||
error: tuple struct `S` is private | ||
--> $DIR/privacy-struct-ctor.rs:43:5 | ||
| | ||
43 | xcrate::m::S; //~ ERROR tuple struct `S` is private | ||
| ^^^^^^^^^^^^ | ||
|
||
error: tuple struct `Z` is private | ||
--> $DIR/privacy-struct-ctor.rs:47:5 | ||
| | ||
47 | xcrate::m::n::Z; //~ ERROR tuple struct `Z` is private | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 8 previous errors | ||
|