diff --git a/ci/style.rs b/ci/style.rs index 79574eb44e18d..b0b6d124f4b9c 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