summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0777.md
blob: 8c5c6e28b65c6750a4eef3a4f9d443b0da723467 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
A literal value was used inside `#[derive]`.

Erroneous code example:

```compile_fail,E0777
#[derive("Clone")] // error!
struct Foo;
```

Only paths to traits are allowed as argument inside `#[derive]`. You can find
more information about the `#[derive]` attribute in the [Rust Book].


```
#[derive(Clone)] // ok!
struct Foo;
```

[Rust Book]: https://doc.rust-lang.org/book/appendix-03-derivable-traits.html