# 错误[E0432]：无法解析导入 `crate::module::submodule` -- 在 `module` 中找不到 `submodule`

- **ID:** `rust/e0432-unresolved-import-could-not-find-module`
- **领域:** rust
- **类别:** module_error
- **错误码:** `E0432`
- **验证级别:** ai_generated
- **修复率:** 92%

## 根因

子模块文件或目录不存在，或父模块中缺少模块声明。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Rust 1.70.0 | active | — | — |
| Rust 1.78.0 | active | — | — |
| Rust 1.82.0 | active | — | — |

## 解决方案

1. ```
   Create the missing file `src/module/submodule.rs` and add `pub mod submodule;` in `src/module/mod.rs` or `src/module.rs`
   ```
2. ```
   If the module is a directory, ensure it contains a `mod.rs` file that declares the submodule
   ```

## 无效尝试

- **Add `pub mod submodule;` to lib.rs or main.rs even if submodule is in a subdirectory** — The declaration must be in the parent module file (e.g., `module/mod.rs` or `module.rs`), not necessarily the crate root. (70% 失败率)
- **Use `#[path = "path/to/submodule.rs"]` without creating the actual file** — The file must exist on disk; the path attribute only overrides the default lookup path. (85% 失败率)
