use crate::foo::Bar;
mod foo {use crate::bar::Bar;}
pub mod bar {pub struct Bar;}
this kind of thing happens pretty often for me, where I try importing from the wrong module.
This gives me the following error:
error[E0603]: struct `Bar` is private
--> src/main.rs:3:17
|
3 | use crate::foo::Bar;
| ^^^
this is misleading because most Rust mental models don't consider use statements to be private instances, they just work that way.
Ideally, this error would notice that it's a private use statement, and instead backtrack it to find the actual path that should be used.
this kind of thing happens pretty often for me, where I try importing from the wrong module.
This gives me the following error:
this is misleading because most Rust mental models don't consider
usestatements to be private instances, they just work that way.Ideally, this error would notice that it's a private use statement, and instead backtrack it to find the actual path that should be used.