diff options
author | Amanieu d'Antras <amanieu@gmail.com> | 2021-02-01 22:53:00 +0000 |
---|---|---|
committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-02-01 22:53:00 +0000 |
commit | 6c7f2a065d1cfd64306cee7d990e2025717c678b (patch) | |
tree | c8593da39f9afc0f44ee621fed35111bddf8dc61 /ci | |
parent | 9d393107c62d92408cd216053e2acabd707ba485 (diff) | |
download | rust-libc-6c7f2a065d1cfd64306cee7d990e2025717c678b.tar.gz |
Update style.rs for new Rustfmt style
Diffstat (limited to 'ci')
-rw-r--r-- | ci/style.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ci/style.rs b/ci/style.rs index 79574eb44e..b0b6d124f4 100644 --- a/ci/style.rs +++ b/ci/style.rs @@ -125,7 +125,8 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) { if line.len() > 80 { err.error(path, i, "line longer than 80 chars"); } - if line.contains("#[cfg(") && !line.contains(" if ") + // This doesn't work any more due to rustfmt changes + /*if line.contains("#[cfg(") && !line.contains(" if ") && !(line.contains("target_endian") || line.contains("target_arch")) { @@ -133,11 +134,12 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) { err.error(path, i, "use cfg_if! and submodules \ instead of #[cfg]"); } - } + }*/ if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) { err.error(path, i, "impl ::Copy and ::Clone manually"); } + let orig_line = line; let line = line.trim_start(); let is_pub = line.starts_with("pub "); let line = if is_pub {&line[4..]} else {line}; @@ -161,7 +163,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) { } else if line.starts_with("f! {") { f_macros += 1; State::FunctionDefinitions - } else if line.starts_with("extern ") { + } else if line.starts_with("extern ") && !orig_line.starts_with(" ") { State::Functions } else if line.starts_with("mod ") { State::Modules |