summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2020-08-19 23:03:28 -0700
committerJosh Triplett <josh@joshtriplett.org>2020-08-19 23:03:28 -0700
commit6b52ae1544808ea55895456e644e30293295a17f (patch)
tree6c98b8b3521a2c2f275d253af2fd78e8a58f15af
parentb1144cc924e61c803e51b6fcd0888d41fa2cb759 (diff)
downloadrust-libc-6b52ae1544808ea55895456e644e30293295a17f.tar.gz
ci/style.rs: Catch derives of Copy and Clone
Let's prevent this from happening again.
-rw-r--r--ci/style.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/ci/style.rs b/ci/style.rs
index dcb3536ec3..79574eb44e 100644
--- a/ci/style.rs
+++ b/ci/style.rs
@@ -134,6 +134,9 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
instead of #[cfg]");
}
}
+ if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) {
+ err.error(path, i, "impl ::Copy and ::Clone manually");
+ }
let line = line.trim_start();
let is_pub = line.starts_with("pub ");