parent
1d69e3b1d7
commit
48bc398207
3 changed files with 28 additions and 4 deletions
10
src/test/ui/privacy/issue-75062-fieldless-tuple-struct.rs
Normal file
10
src/test/ui/privacy/issue-75062-fieldless-tuple-struct.rs
Normal file
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue