about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-01-20 19:42:41 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-01-21 21:26:37 +0000
commit922e6bb2d4a5828cc12499c4f3dca685c3fd9002 (patch)
tree2ca667f812a92aa52c70836792ec1828a82fe9c3 /compiler/rustc_codegen_gcc
parent6a64e3b89724395d87a394ed9ebd954c474b080a (diff)
downloadrust-922e6bb2d4a5828cc12499c4f3dca685c3fd9002.tar.gz
rust-922e6bb2d4a5828cc12499c4f3dca685c3fd9002.zip
Detect missing fields with default values and suggest `..`
When a struct definition has default field values, and the use struct ctor has missing field, if all those missing fields have defaults suggest `..`:

```
error[E0063]: missing fields `field1` and `field2` in initializer of `S`
  --> $DIR/non-exhaustive-ctor.rs:16:13
   |
LL |     let _ = S { field: () };
   |             ^ missing `field1` and `field2`
   |
help: all remaining fields have defaults, use `..`
   |
LL |     let _ = S { field: (), .. };
   |                          ++++
```
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions