diff options
Diffstat (limited to 'src/tools/clippy/src/docs/alloc_instead_of_core.txt')
-rw-r--r-- | src/tools/clippy/src/docs/alloc_instead_of_core.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/alloc_instead_of_core.txt b/src/tools/clippy/src/docs/alloc_instead_of_core.txt new file mode 100644 index 000000000..488a36e92 --- /dev/null +++ b/src/tools/clippy/src/docs/alloc_instead_of_core.txt @@ -0,0 +1,18 @@ +### What it does + +Finds items imported through `alloc` when available through `core`. + +### Why is this bad? + +Crates which have `no_std` compatibility and may optionally require alloc may wish to ensure types are +imported from core to ensure disabling `alloc` does not cause the crate to fail to compile. This lint +is also useful for crates migrating to become `no_std` compatible. + +### Example +``` +use alloc::slice::from_ref; +``` +Use instead: +``` +use core::slice::from_ref; +```
\ No newline at end of file |