-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle fieldless tuple structs in diagnostic code
Fixes #75062
- Loading branch information
Showing
3 changed files
with
28 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Regression test for issue #75062 | ||
// Tests that we don't ICE on a privacy error for a fieldless tuple struct. | ||
|
||
mod foo { | ||
struct Bar(); | ||
} | ||
|
||
fn main() { | ||
foo::Bar(); //~ ERROR tuple struct | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/privacy/issue-75062-fieldless-tuple-struct.stderr
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,15 @@ | ||
error[E0603]: tuple struct `Bar` is private | ||
--> $DIR/issue-75062-fieldless-tuple-struct.rs:9:10 | ||
| | ||
LL | foo::Bar(); | ||
| ^^^ private tuple struct | ||
| | ||
note: the tuple struct `Bar` is defined here | ||
--> $DIR/issue-75062-fieldless-tuple-struct.rs:5:5 | ||
| | ||
LL | struct Bar(); | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0603`. |