]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0777.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0777.md
1 A literal value was used inside `#[derive]`.
2
3 Erroneous code example:
4
5 ```compile_fail,E0777
6 #[derive("Clone")] // error!
7 struct Foo;
8 ```
9
10 Only paths to traits are allowed as argument inside `#[derive]`. You can find
11 more information about the `#[derive]` attribute in the [Rust Book].
12
13
14 ```
15 #[derive(Clone)] // ok!
16 struct Foo;
17 ```
18
19 [Rust Book]: https://doc.rust-lang.org/book/appendix-03-derivable-traits.html