I am having difficulty understanding the
use rule for
std in crate.
Say I have a
lib.rs sitting in
src/. I want to use fully qualified
std functions or traits, such as
std::io::Read in my crate. I can only reference as
::std::io::Read, but not
std::io::Read. I can’t use
use ::std in the crate either, because the compiler complains it “conflicts with imported crate”.
I can use
use ::std in the submodule though, so that
std::io::Read works in this submodule after the
use ::std added at the start of the module.
Can someone please explain how
std is defaultly imported in the crate root?