diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-11-30 09:28:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-30 09:28:25 +0100 |
| commit | 13ded6651346893f9ee28ba8770c8aa1268c593f (patch) | |
| tree | fd74347f14582b2f1f4e7d1f0f32ba14122ebde5 /tests/ui/issues | |
| parent | e9a870d5ebebb26833a1789adcb4db53de260025 (diff) | |
| parent | 4be07075b3651a69f05b9b9f16312fe3a8cf21fd (diff) | |
| download | rust-13ded6651346893f9ee28ba8770c8aa1268c593f.tar.gz rust-13ded6651346893f9ee28ba8770c8aa1268c593f.zip | |
Rollup merge of #118453 - estebank:priv-fields, r=compiler-errors
Tweak message on ADT with private fields building
When trying to create an inaccessible ADT due to private fields, handle the case when no fields were passed.
```
error: cannot construct `Foo` with struct literal syntax due to private fields
--> $DIR/issue-76077.rs:8:5
|
LL | foo::Foo {};
| ^^^^^^^^
|
= note: private field `you_cant_use_this_field` that was not provided
```
Diffstat (limited to 'tests/ui/issues')
| -rw-r--r-- | tests/ui/issues/issue-76077.stderr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/issues/issue-76077.stderr b/tests/ui/issues/issue-76077.stderr index 4c510e91ada..3fef5ffce30 100644 --- a/tests/ui/issues/issue-76077.stderr +++ b/tests/ui/issues/issue-76077.stderr @@ -4,7 +4,7 @@ error: cannot construct `Foo` with struct literal syntax due to private fields LL | foo::Foo {}; | ^^^^^^^^ | - = note: ... and other private field `you_cant_use_this_field` that was not provided + = note: private field `you_cant_use_this_field` that was not provided error: aborting due to 1 previous error |
