I have a lib.rs
file containing:
mod bindings {
// ...
}
pub use bindings::*;
What I get from rustc
is:
| pub use bindings::*;
| ^^^^^^^^ can't find crate
Why does Rust think bindings
is a crate instead of module?
I have a lib.rs
file containing:
mod bindings {
// ...
}
pub use bindings::*;
What I get from rustc
is:
| pub use bindings::*;
| ^^^^^^^^ can't find crate
Why does Rust think bindings
is a crate instead of module?
You seem to be using the 2018 edition of Rust. There have been a few changes to paths in use
declarations since the 2015 edition (aka Rust 1.0). The path after a use
declaration now always needs to start with a crate name, the crate
keyword denoting the root of the crate, self
denoting the current module or super
denoting the parent module. So either of these two use
declarations should work:
pub use self::bindings::*;
or
pub use crate::bindings::*;