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
..
2024-12-27 19:58:16 +11:00
2024-12-12 23:36:27 +00:00
2024-11-27 07:18:25 -08:00
2024-12-27 19:58:16 +11:00
2024-11-26 21:57:32 +00:00
2024-12-23 22:15:32 +00:00
2024-12-22 14:49:01 +08:00
2024-12-27 11:44:23 +01:00
2024-12-01 08:15:25 +01:00
2024-12-30 14:56:21 +07:00
2024-12-31 00:46:46 +00:00
2024-12-27 19:58:16 +11:00
2024-12-07 21:37:13 +00:00
2024-11-27 07:18:25 -08:00
2024-12-05 23:52:21 +00:00
2024-12-25 20:44:20 +08:00
2024-12-04 20:29:36 +00:00
2024-12-07 21:37:13 +00:00
2024-12-20 02:38:46 +08:00
2024-12-31 02:21:17 +00:00
2024-12-02 18:43:37 +01:00
2024-12-31 02:21:17 +00:00
2024-12-07 21:37:13 +00:00
2024-11-30 12:56:54 +08:00
2024-11-27 07:18:25 -08:00
2024-12-27 19:58:16 +11:00
2024-12-31 15:11:18 +08:00
2024-11-27 22:21:33 +01:00
2024-12-27 19:58:16 +11:00
2024-12-12 23:36:27 +00:00
2024-12-12 23:36:27 +00:00
2024-12-07 21:26:20 +00:00
2024-12-28 13:57:13 +11:00
2024-12-04 20:29:35 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-30 23:46:42 +00:00
2024-12-31 15:11:18 +08:00
2024-12-25 19:23:48 +11:00
2024-12-27 19:58:16 +11:00
2024-12-02 18:43:37 +01:00
2024-12-09 21:06:29 +08:00
2024-12-27 12:42:07 +11:00
2024-11-27 07:18:25 -08:00
2024-12-04 20:34:48 +08:00
2024-12-09 21:55:01 +00:00
2024-12-18 07:10:55 +01:00
2024-12-10 11:29:43 +08:00
2024-12-27 19:58:16 +11:00
2024-12-23 20:25:41 +00:00
2024-12-07 21:29:58 +00:00
2024-12-31 23:46:39 +08:00
2024-12-11 19:53:40 +00:00
2024-12-22 21:59:27 +01:00
2024-12-15 20:28:16 -08:00
2024-12-09 15:17:26 +01:00
2024-12-27 19:58:16 +11:00
2024-12-26 17:41:43 +00:00
2024-12-27 19:58:16 +11:00
2024-12-23 22:15:32 +00:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-12-24 00:51:51 +00:00
2024-12-30 06:14:26 -08:00
2024-11-26 15:32:18 +01:00
2024-12-12 23:36:27 +00:00
2024-12-19 10:56:31 +00:00
2024-12-12 23:36:27 +00:00
2024-12-13 13:07:07 +01:00
2024-12-31 02:21:17 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:47:10 +01:00
2024-12-27 19:58:16 +11:00
2024-12-31 23:46:39 +08:00
2024-12-31 23:46:39 +08:00
2024-12-31 23:46:39 +08:00
2024-12-27 19:58:16 +11:00
2024-11-27 07:18:25 -08:00
2024-12-04 20:49:05 +00:00
2024-12-17 13:56:10 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-30 19:10:43 +08:00
2024-12-27 19:58:16 +11:00
2025-01-01 16:35:31 +11:00
2024-12-15 20:28:16 -08:00
2024-12-07 21:29:58 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-07 21:29:58 +00:00
2024-12-13 14:18:41 -08:00
2024-12-14 03:54:31 +01:00
2024-12-27 19:58:16 +11:00
2024-12-31 02:25:35 +00:00
2024-12-07 13:18:05 +11:00
2024-12-27 19:58:16 +11:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-12-12 23:36:27 +00:00
2024-12-27 20:44:12 +08:00
2024-12-31 18:42:23 -05:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-07 18:18:08 +00:00
2024-12-07 21:29:58 +00:00
2024-12-27 19:58:16 +11:00
2024-12-31 18:42:23 -05:00
2024-12-15 20:28:16 -08:00
2024-12-31 18:42:23 -05:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-31 15:11:18 +08:00
2024-12-31 05:03:22 +00:00
2024-12-31 18:42:23 -05:00
2024-12-27 19:58:16 +11:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-09 21:55:12 +00:00
2024-12-14 06:44:05 +00:00
2024-12-24 19:12:13 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-12-28 11:19:16 +08:00
2024-11-27 07:18:25 -08:00
2024-11-27 07:18:25 -08:00
2024-12-15 20:28:16 -08:00
2024-12-17 13:56:10 +11:00
2024-12-13 00:04:56 +00:00
2024-12-21 01:30:16 +01:00
2024-12-03 07:48:33 +01:00
2024-12-13 15:40:37 +00:00
2024-12-15 04:45:24 +00:00
2024-12-12 23:36:27 +00:00
2024-12-14 22:43:39 +00:00
2024-12-23 22:15:32 +00:00
2024-12-27 19:58:16 +11:00
2024-12-17 15:17:28 +11:00
2024-12-08 15:32:04 +08:00
2024-12-31 18:06:01 +00:00
2024-12-16 14:59:10 -05:00
2025-01-01 16:35:30 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-15 19:14:24 +00:00
2024-12-27 19:58:16 +11:00
2024-12-09 21:55:01 +00:00
2024-12-25 10:36:32 +01:00
2024-12-23 20:25:41 +00:00
2024-12-27 19:58:16 +11:00
2024-12-07 22:18:51 +00:00
2025-01-01 16:35:30 +11:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-07 21:29:58 +00:00
2024-12-27 19:58:16 +11:00
2024-12-07 21:37:15 +00:00
2024-12-14 03:54:31 +01:00
2024-12-23 22:15:32 +00:00
2024-12-13 15:40:37 +00:00
2024-11-27 07:18:25 -08:00
2024-12-07 21:37:13 +00:00
2024-12-18 19:27:44 +00:00
2024-12-07 21:37:13 +00:00
2024-12-27 19:58:16 +11:00
2024-12-15 20:28:16 -08:00
2024-12-22 21:57:57 +00:00
2024-12-07 20:50:00 +00:00
2024-12-06 16:42:09 -05:00
2024-12-07 21:29:58 +00:00
2024-12-07 21:29:58 +00:00
2024-12-12 23:36:27 +00:00
2024-12-27 19:58:16 +11:00
2024-11-28 14:32:45 -08:00
2024-12-07 21:29:58 +00:00
2024-12-02 03:43:50 -07:00
2024-12-27 19:58:16 +11:00