Skip to content

Commit 3c371e5

Browse files
committed
libc-test: add allowlist for positive s! marco configs
Namely, this allows `target_endian` as well as adds a constant array where `musl32_time64` is explicitly allowed.
1 parent e069e26 commit 3c371e5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc-test/test/style/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use syn::visit::{self, Visit};
3838
use syn::Token;
3939

4040
const ALLOWED_REPEATED_MACROS: &[&str] = &["s", "s_no_extra_traits", "s_paren"];
41+
const ALLOWED_POSITIVE_S_CFGS: &[&str] = &["musl32_time64"];
4142

4243
pub type Error = Box<dyn std::error::Error>;
4344
pub type Result<T> = std::result::Result<T, Error>;
@@ -272,6 +273,8 @@ impl StyleChecker {
272273
if !meta_str.starts_with("not")
273274
&& !meta_str.starts_with("any")
274275
&& !meta_str.starts_with("all")
276+
&& !meta_str.starts_with("target_endian")
277+
&& !ALLOWED_POSITIVE_S_CFGS.contains(&meta_str.as_str())
275278
{
276279
self.error(
277280
"positive #[cfg] for s! macro".to_string(),

0 commit comments

Comments
 (0)