Failed to resolve undeclared crate/module
Hello, all!
I have been using rust for a little while, and I've gotten this error many times before, but not like this. I am declaring a pub struct in a pub module, and even when I do not use it anywhere else in my project, I am getting this lint/compile error:
error[E0433]: failed to resolve: use of undeclared crate or module `date_time_utc_forms`
--> domain/src/utils/date_time_utc_form.rs:13:12
|
13 | pub struct DateTimeUtcForm {
| ^^^^^^^^^^^^^^^ use of undeclared crate or module `date_time_utc_forms`
The tree structure for this project is as follows (removed unrelated directories):
.
├── Cargo.lock
├── Cargo.toml
├── Dockerfile
├── rocket.toml
├── api
│ ├── Cargo.toml
│ └── src
│ ├── bin
│ │ └── main.rs
│ ├── lib.rs
│ └── post_handler.rs
├── domain
│ ├── Cargo.toml
│ └── src
│ ├── lib.rs
│ ├── models
│ │ ├── mod.rs
│ │ ├── photo.rs
│ │ └── post.rs
│ ├── schema.rs
│ └── utils
│ ├── date_time_utc_form.rs
│ └── mod.rs
I am trying to use this DateTimeUtcForm struct in my api
crate, and it imports successfully there, which is weird, because why then am I getting that error? Even when I don't use it in api
I still have the compile and lint errors. One thing I've notices is that it is calling the module date_time_utc_forms
with an 's', even though I do not declare it with an 's' or import it with an 's' anywhere.
Here is my DateTimeUtcForm struct:
#[derive(Queryable, Insertable, Selectable, Serialize, Deserialize, Ord, Eq, PartialEq, PartialOrd, Debug)]
pub struct DateTimeUtcForm {
pub time_taken: DateTime<Utc>,
}
I've noticed when I take off the Insertable
and Selectable
derives the issue seems to go away, so is this an issue with Diesel? I am using Diesel as an ORM, and the time_taken row on my diesel tables are of type Timestamptz. I feel like I have tried everything and read every StackOverflow post there is to read about this error, but I still have no luck. If you'd like to look at the full codebase, it's here. Any help or insight would be greatly appreciated! Thank you!
Source: View source