rust/compiler/rustc_lint
Stuart Cook 65cb7c66d0
Rollup merge of #134979 - estebank:default-lint-sugg, r=compiler-errors
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.
2025-01-01 16:35:32 +11:00
..
src Rollup merge of #134979 - estebank:default-lint-sugg, r=compiler-errors 2025-01-01 16:35:32 +11:00
Cargo.toml rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
messages.ftl Rollup merge of #134202 - nnethercote:rm-existing_doc_keyword, r=GuillaumeGomez 2024-12-17 05:36:52 -05:00