summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/std_instead_of_alloc.txt
blob: c2d32704e50551a82049d700a1a18ea77dfdefd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
### What it does

Finds items imported through `std` when available through `alloc`.

### Why is this bad?

Crates which have `no_std` compatibility and require alloc may wish to ensure types are imported from
alloc to ensure disabling `std` does not cause the crate to fail to compile. This lint is also useful
for crates migrating to become `no_std` compatible.

### Example
```
use std::vec::Vec;
```
Use instead:
```
use alloc::vec::Vec;
```