Closed
Description
When working with libraries that can or can not be #[no_std]
, it is common to simply extern crate alloc;
and then manually import types like alloc::vec::Vec
. In this way everything works regardless of the configuration.
However, the latest versions of the compiler are warning such approach.
warning: the item
Vec
is imported redundantly
--> foo.rs:96:7
|
96 | use alloc::vec::Vec;
| ^^^^^^^^^^^^^^^
|
::: $HOME/.rustup/toolchains/nightly-2024-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
|
125 | pub use super::v1::*;
| --------- the itemVec
is already defined here
In the above example, if use alloc::vec::Vec;
is removed #[no_std]
breaks. If not removed, the warning persists 😑