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

Ignore usage of std in extra binaries #26

Open
shepmaster opened this issue May 15, 2019 · 1 comment
Open

Ignore usage of std in extra binaries #26

shepmaster opened this issue May 15, 2019 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@shepmaster
Copy link

I have a little test program paired with my no-std library. cargo nono reports this, although no one but me will ever make use of it:

$ cargo nono check --no-default-features --package twox-hash
twox-hash: ❌
  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Did not find a #![no_std] attribute or a simple conditional attribute like #[cfg_attr(not(feature = "std"), no_std)] in the crate source. Crate most likely doesn't support no_std without changes.
  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

  - Source code contains an explicit `use std::` statement.
   --> src/bin/hash_file.rs

There doesn't appear to be any flags to report on only the library.

@hobofan
Copy link
Owner

hobofan commented May 16, 2019

Thanks for the feedback!

Yeah, I don't think we have such a flag at the moment.

Adding a --only-lib flag that causes src/main.rs and src/bin/**/*.rs to be ignored sounds reasonable.

@hobofan hobofan added enhancement New feature or request help wanted Extra attention is needed labels Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants