diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-12-31 18:06:01 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-31 18:06:01 +0000 |
| commit | 2b2ea9e875dc9ae6c2d351078f1f43e533c9d780 (patch) | |
| tree | dbbc1294b034869d46a03d36449b1ea29f44c9ea /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 7a0cde96f83c6d38237bb8062df6300ecf4c2687 (diff) | |
| download | rust-2b2ea9e875dc9ae6c2d351078f1f43e533c9d780.tar.gz rust-2b2ea9e875dc9ae6c2d351078f1f43e533c9d780.zip | |
Provide structured suggestion for `impl Default` of type where all fields have defaults
```
error: `Default` impl doesn't use the declared default field values
--> $DIR/manual-default-impl-could-be-derived.rs:28:1
|
LL | / impl Default for B {
LL | | fn default() -> Self {
LL | | B {
LL | | x: s(),
| | --- this field has a default value
LL | | y: 0,
| | - this field has a default value
... |
LL | | }
| |_^
|
help: to avoid divergence in behavior between `Struct { .. }` and `<Struct as Default>::default()`, derive the `Default`
|
LL ~ #[derive(Default)] struct B {
|
```
Note that above the structured suggestion also includes completely removing the manual `impl`, but the rendering doesn't.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
