Closed
Description
Consider this test case in Rust 2018 (playground):
mod foo {
pub(crate) trait Bar {
fn bar(&self) { }
}
impl Bar for u32 { }
}
fn main() {
let x: u32 = 22;
x.bar();
}
I get this error:
error[E0599]: no method named `bar` found for type `u32` in the current scope
--> src/main.rs:11:7
|
11 | x.bar();
| ^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use foo::Bar;
|
I would like to see use crate::foo::Bar
, however.