Skip to content

Commit 92292e7

Browse files
committed
Disable the 1-s!-macro-per-file style rule
Rust 1.14.0 and earlier don't correctly expand #[cfg()] attributes within the macro, sometimes necessitating multiple s! macros per file.
1 parent 0d82fbb commit 92292e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ci/style.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,15 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
177177
}
178178
if s_macros == 2 {
179179
s_macros += 1;
180-
err.error(path, i, "multiple s! macros in one module");
180+
// Can't enforce this rule until after raising the MSRV to 1.19.0 or
181+
// later. It seems that earlier Rust versions ignore #[cfg()]
182+
// attributes within the macro. As a result, it's sometimes
183+
// necessary to have multiple s!{} macros in a single file. It's
184+
// hard to debug, because cargo-expand doesn't work with such
185+
// old versions.
186+
// See also https://github.com/rust-lang/libc/pull/2813
187+
188+
// err.error(path, i, "multiple s! macros in one module");
181189
}
182190

183191
state = line_state;

0 commit comments

Comments
 (0)