I have main.rs and bear.rs under the src directory. Every time I compile, the compiler points to E0658. I've read the docs for E0658, and it tells me that this is an unstable feature.
main.rs
mod bear;
use bear::factory::make_bear;
fn main() {
println!("Hello, world!");
let bear = make_bear();
}
bear.rs
pub mod factory {
pub fn make_bear() -> Bear {
// code to instantiate Bear struct.
}
}
When I compile this code I get this from the compiler:
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
--> src/main.rs:1:5
|
1 | use bear::factory::make_bear;
| ^^^^
...
8 | / mod bear {
9 | | pub mod factory {
10 | | pub fn make_bear() -> Bear {
11 | | // code to instantiate Bear struct.
12 | | }
13 | | }
14 | | }
| |_- not an extern crate passed with `--extern`
|
Do I have to wait for consensus among the Rust community, or is there something I can do right now besides the inconvenient suggestion in the docs?