ci/style.rs: Catch derives of Copy and Clone

Let's prevent this from happening again.
This commit is contained in:
Josh Triplett 2020-08-19 23:03:28 -07:00
parent b1144cc924
commit 6b52ae1544
1 changed files with 3 additions and 0 deletions

View File

@ -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 ");