You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an import is a type exposed in core or alloc, the lint should warn that a the type could be imported using core or alloc instead.
Lint Name
prefer_core_alloc_imports
Category
pedantic
Advantage
For crates which support no_std environments, this makes finding accidental std import additions easier that could break the crate when compiling for a no_std environment.
Drawbacks
Crates which reexport core, alloc or std might behave differently.
Example
use std::mem::size_of;use std::vec::Vec;
Could be written as:
use core::mem::size_of;use alloc::vec::Vec;
The text was updated successfully, but these errors were encountered:
What it does
If an import is a type exposed in
core
oralloc
, the lint should warn that a the type could be imported usingcore
oralloc
instead.Lint Name
prefer_core_alloc_imports
Category
pedantic
Advantage
Drawbacks
Example
Could be written as:
The text was updated successfully, but these errors were encountered: