Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo-nono does not detect #![cfg_attr(not(any(test, doctest)), no_std)] #61

Open
abdes opened this issue Nov 19, 2020 · 4 comments
Open

Comments

@abdes
Copy link

abdes commented Nov 19, 2020

A crate with #![cfg_attr(not(any(test, doctest)), no_std)] definitely does not need std for it to be used, although it uses std for some of its own tests.

Is there any reason why this pattern is considered not valid by cargo-nono?

@laysakura
Copy link

Similarly cannot detect #![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
https://github.com/mvdnes/spin-rs/blob/master/src/lib.rs#L1

@kpp
Copy link

kpp commented Jun 24, 2021

Cannot detect #![cfg_attr(not(any(test, feature = "std")), no_std)]

@john-anchor
Copy link

john-anchor commented Jun 13, 2022

Seeing this erroneously flag base64-0.13.0 due to #[cfg(any(feature = "std", test))]

@hobofan
Copy link
Owner

hobofan commented Nov 18, 2022

In case I/someone wants to include a robust solution for this: I just stumbled upon https://crates.io/crates/cfg-expr, which cargo-nono should be able to leverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants