{
  "id": "rust/e0583-file-not-found-for-module",
  "signature": "error[E0583]: file not found for module `module_name`",
  "signature_zh": "错误[E0583]：未找到模块 `module_name` 的文件",
  "regex": "error\\[E0583\\]: file not found for module `[a-zA-Z_][a-zA-Z0-9_]*`",
  "domain": "rust",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Rust cannot find the source file for a declared module, either because the file path is incorrect, the file extension is wrong, or the module is not properly declared in `mod.rs` or `lib.rs`.",
  "root_cause_type": "generic",
  "root_cause_zh": "Rust 找不到声明的模块的源文件，可能是因为文件路径错误、文件扩展名错误，或者模块未在 `mod.rs` 或 `lib.rs` 中正确声明。",
  "versions": [
    {
      "version": "rustc 1.68.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rustc 1.70.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rustc 1.74.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Rust expects module files to follow a specific naming convention based on the `mod` declaration; wrong placement won't be recognized.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Rustc only recognizes `.rs` files for module declarations; other extensions are ignored.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the module file is created with the correct name and path: for `mod module_name;` in `src/lib.rs`, create `src/module_name.rs`.",
      "success_rate": 0.95,
      "how": "Ensure the module file is created with the correct name and path: for `mod module_name;` in `src/lib.rs`, create `src/module_name.rs`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the module has submodules, create a directory `src/module_name/` with a `mod.rs` file inside.",
      "success_rate": 0.9,
      "how": "If the module has submodules, create a directory `src/module_name/` with a `mod.rs` file inside.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check for typos in the `mod` declaration and the file name, ensuring they match exactly (case-sensitive).",
      "success_rate": 0.85,
      "how": "Check for typos in the `mod` declaration and the file name, ensuring they match exactly (case-sensitive).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure the module file is created with the correct name and path: for `mod module_name;` in `src/lib.rs`, create `src/module_name.rs`.",
    "If the module has submodules, create a directory `src/module_name/` with a `mod.rs` file inside.",
    "Check for typos in the `mod` declaration and the file name, ensuring they match exactly (case-sensitive)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/error_codes/E0583.html",
  "official_doc_section": null,
  "error_code": "E0583",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-03-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}