@@ -125,19 +125,21 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
125
125
if line. len ( ) > 80 {
126
126
err. error ( path, i, "line longer than 80 chars" ) ;
127
127
}
128
- if line. contains ( "#[cfg(" ) && !line. contains ( " if " )
128
+ // This doesn't work any more due to rustfmt changes
129
+ /*if line.contains("#[cfg(") && !line.contains(" if ")
129
130
&& !(line.contains("target_endian") ||
130
131
line.contains("target_arch"))
131
132
{
132
133
if state != State::Structs {
133
134
err.error(path, i, "use cfg_if! and submodules \
134
135
instead of #[cfg]");
135
136
}
136
- }
137
+ }*/
137
138
if line. contains ( "#[derive(" ) && ( line. contains ( "Copy" ) || line. contains ( "Clone" ) ) {
138
139
err. error ( path, i, "impl ::Copy and ::Clone manually" ) ;
139
140
}
140
141
142
+ let orig_line = line;
141
143
let line = line. trim_start ( ) ;
142
144
let is_pub = line. starts_with ( "pub " ) ;
143
145
let line = if is_pub { & line[ 4 ..] } else { line} ;
@@ -161,7 +163,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
161
163
} else if line. starts_with ( "f! {" ) {
162
164
f_macros += 1 ;
163
165
State :: FunctionDefinitions
164
- } else if line. starts_with ( "extern " ) {
166
+ } else if line. starts_with ( "extern " ) && !orig_line . starts_with ( " " ) {
165
167
State :: Functions
166
168
} else if line. starts_with ( "mod " ) {
167
169
State :: Modules
0 commit comments