about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-01-20 12:37:54 +0800
committerGitHub <noreply@github.com>2025-01-20 12:37:54 +0800
commit6db2d1aae5d74f57f5218bcf6c839f2e653f1ac2 (patch)
tree76e83804b684a5097e524445eee02d54fd6a3b6f /compiler/rustc_interface/src
parent5740a552e3ed402c6f5a5c20abdd2ae82f8681eb (diff)
parentdeef3ebaec2ff0ff818161f3b9b86a42bed5fe36 (diff)
downloadrust-6db2d1aae5d74f57f5218bcf6c839f2e653f1ac2.tar.gz
rust-6db2d1aae5d74f57f5218bcf6c839f2e653f1ac2.zip
Rollup merge of #135700 - estebank:priv-field-dfv, r=wesleywiser
Emit single privacy error for struct literal with multiple private fields and add test for `default_field_values` privacy

Add test ensuring that struct with default field values is not constructable if the fields are not accessible.

Collect all unreachable fields in a single struct literal struct and emit a single error, instead of one error per private field.

```
error[E0451]: fields `beta` and `gamma` of struct `Alpha` are private
  --> $DIR/visibility.rs:18:13
   |
LL |     let _x = Alpha {
   |              ----- in this type
LL |         beta: 0,
   |         ^^^^^^^ private field
LL |         ..
   |         ^^ field `gamma` is private
```
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions