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

False positives when using extern crate core as std; #57

Open
regexident opened this issue Jul 22, 2020 · 0 comments
Open

False positives when using extern crate core as std; #57

regexident opened this issue Jul 22, 2020 · 0 comments

Comments

@regexident
Copy link
Contributor

A fairly common pattern in no_std-compatible projects is to put this in your lib.rs file:

extern crate core as std;

… which allows you to then keep using use std::…, instead of having to use use core::….

Running $ cargo nono check on the lazycell crate, which uses aforementioned trick produces the following errors:

❯ cargo nono check
lazycell: ❌
  - Source code contains an explicit `use std::` statement.
   --> src/lib.rs

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

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

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

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

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

… even though the crate is safe to use for no_std.

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

1 participant