about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/derivable_impls_derive_const.stderr
blob: 196bac185ddaadbee882775e2a51c6fc4df03bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
error: this `impl` can be derived
  --> tests/ui/derivable_impls_derive_const.rs:11:5
   |
LL | /     impl const Default for Foo {
LL | |
LL | |         fn default() -> Self {
LL | |             Self(0)
LL | |         }
LL | |     }
   | |_____^
   |
   = note: `-D clippy::derivable-impls` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::derivable_impls)]`
help: replace the manual implementation with a derive attribute
   |
LL ~     #[derive_const(Default)]
LL ~     struct Foo(u64);
LL |
LL ~     
   |

error: this `impl` can be derived
  --> tests/ui/derivable_impls_derive_const.rs:24:5
   |
LL | /     impl const Default for Bar {
LL | |
LL | |         fn default() -> Self {
LL | |             Bar::A
LL | |         }
LL | |     }
   | |_____^
   |
help: replace the manual implementation with a derive attribute and mark the default variant
   |
LL ~     #[derive_const(Default)]
LL ~     enum Bar {
LL ~         #[default]
LL ~         A,
LL |         B,
LL |     }
LL |
LL ~     
   |

error: aborting due to 2 previous errors