{
  "id": "rust/e0433-module-not-found-workspace",
  "signature": "error[E0433]: failed to resolve: use of undeclared crate or module `my_crate`\n\n  --> src/main.rs:2:5\n   |\n 2 | use my_crate::some_module;\n   |     ^^^^^^^^ use of undeclared crate or module `my_crate`",
  "signature_zh": "错误[E0433]：解析失败：使用了未声明的 crate 或模块 `my_crate`\n\n  --> src/main.rs:2:5\n   |\n 2 | use my_crate::some_module;\n   |     ^^^^^^^^ 使用了未声明的 crate 或模块 `my_crate`",
  "regex": "error\\[E0433\\]: failed to resolve: use of undeclared crate or module `[a-zA-Z_][a-zA-Z0-9_]*`",
  "domain": "rust",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "Attempting to use a crate that is not listed as a dependency in `Cargo.toml`, or a module that is not declared via `mod`.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试使用一个未在 `Cargo.toml` 中列为依赖的 crate，或未通过 `mod` 声明的模块。",
  "versions": [
    {
      "version": "rustc 1.73",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cargo 1.73",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Cargo cannot find the crate; no matching package available.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "In Rust 2018+, `extern crate` is rarely needed and still requires the crate to be in dependencies.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the missing crate to `Cargo.toml`: `my_crate = \"1.0\"` and run `cargo build`.",
      "success_rate": 0.95,
      "how": "Add the missing crate to `Cargo.toml`: `my_crate = \"1.0\"` and run `cargo build`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If it's a local module, declare it with `mod my_module;` in `main.rs` or `lib.rs`.",
      "success_rate": 0.9,
      "how": "If it's a local module, declare it with `mod my_module;` in `main.rs` or `lib.rs`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将缺失的 crate 添加到 `Cargo.toml`：`my_crate = \"1.0\"` 并运行 `cargo build`。",
    "如果是本地模块，在 `main.rs` 或 `lib.rs` 中使用 `mod my_module;` 声明它。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/stable/error_codes/E0433.html",
  "official_doc_section": null,
  "error_code": "E0433",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.93,
  "resolvable": "true",
  "first_seen": "2023-07-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}