Open regexident opened 4 years ago
A fairly common pattern in no_std-compatible projects is to put this in your lib.rs file:
no_std
lib.rs
extern crate core as std;
… which allows you to then keep using use std::…, instead of having to use use core::….
use std::…
use core::…
Running $ cargo nono check on the lazycell crate, which uses aforementioned trick produces the following errors:
$ cargo nono check
lazycell
❯ 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.
A fairly common pattern in
no_std
-compatible projects is to put this in yourlib.rs
file:… which allows you to then keep using
use std::…
, instead of having to useuse core::…
.Running
$ cargo nono check
on thelazycell
crate, which uses aforementioned trick produces the following errors:… even though the crate is safe to use for
no_std
.