{
  "id": "rust/e0432-unresolved-import-could-not-find-module",
  "signature": "error[E0432]: unresolved import `crate::module::submodule` -- could not find `submodule` in `module`",
  "signature_zh": "错误[E0432]：无法解析导入 `crate::module::submodule` -- 在 `module` 中找不到 `submodule`",
  "regex": "error\\[E0432\\]: unresolved import `crate::\\w+(::\\w+)+` -- could not find `\\w+` in `\\w+`",
  "domain": "rust",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "The submodule file or directory does not exist, or the module declaration is missing in the parent module.",
  "root_cause_type": "generic",
  "root_cause_zh": "子模块文件或目录不存在，或父模块中缺少模块声明。",
  "versions": [
    {
      "version": "Rust 1.70.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Rust 1.78.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Rust 1.82.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Add `pub mod submodule;` to lib.rs or main.rs even if submodule is in a subdirectory",
      "why_fails": "The declaration must be in the parent module file (e.g., `module/mod.rs` or `module.rs`), not necessarily the crate root.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `#[path = \"path/to/submodule.rs\"]` without creating the actual file",
      "why_fails": "The file must exist on disk; the path attribute only overrides the default lookup path.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create the missing file `src/module/submodule.rs` and add `pub mod submodule;` in `src/module/mod.rs` or `src/module.rs`",
      "success_rate": 0.95,
      "how": "Create the missing file `src/module/submodule.rs` and add `pub mod submodule;` in `src/module/mod.rs` or `src/module.rs`",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the module is a directory, ensure it contains a `mod.rs` file that declares the submodule",
      "success_rate": 0.9,
      "how": "If the module is a directory, ensure it contains a `mod.rs` file that declares the submodule",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Create the missing file `src/module/submodule.rs` and add `pub mod submodule;` in `src/module/mod.rs` or `src/module.rs`",
    "If the module is a directory, ensure it contains a `mod.rs` file that declares the submodule"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/stable/error_codes/E0432.html",
  "official_doc_section": null,
  "error_code": "E0432",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}