about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-10-04 11:45:03 +0900
committerGitHub <noreply@github.com>2020-10-04 11:45:03 +0900
commit830d1a0e32c7ad6d34e22e07d498f4f0eda6fb5b (patch)
tree855e08f9bf1857eb7e000ab841958847e60b4700 /compiler/rustc_error_codes/src
parentf09c962a84ea125152d37ad8c38bca1aef668c07 (diff)
parentd1d94ba026eda45a2b998d68524c14929604c748 (diff)
downloadrust-830d1a0e32c7ad6d34e22e07d498f4f0eda6fb5b.tar.gz
rust-830d1a0e32c7ad6d34e22e07d498f4f0eda6fb5b.zip
Rollup merge of #77419 - GuillaumeGomez:create-e0777, r=jyn514
Create E0777 error code for invalid argument in derive

The second commit is to fix a nit reported by @jyn514 [here](https://github.com/rust-lang/rust/pull/76406/files#r485186592).
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes.rs1
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0777.md19
2 files changed, 20 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs
index 81f65ac8690..981b5bb8ba7 100644
--- a/compiler/rustc_error_codes/src/error_codes.rs
+++ b/compiler/rustc_error_codes/src/error_codes.rs
@@ -459,6 +459,7 @@ E0773: include_str!("./error_codes/E0773.md"),
 E0774: include_str!("./error_codes/E0774.md"),
 E0775: include_str!("./error_codes/E0775.md"),
 E0776: include_str!("./error_codes/E0776.md"),
+E0777: include_str!("./error_codes/E0777.md"),
 ;
 //  E0006, // merged with E0005
 //  E0008, // cannot bind by-move into a pattern guard
diff --git a/compiler/rustc_error_codes/src/error_codes/E0777.md b/compiler/rustc_error_codes/src/error_codes/E0777.md
new file mode 100644
index 00000000000..8c5c6e28b65
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0777.md
@@ -0,0 +1,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