{
  "id": "rust/e0599-no-method-named-find-for-struct-hashmap",
  "signature": "error[E0599]: no method named `find` found for struct `HashMap<String, i32>` in the current scope",
  "signature_zh": "错误[E0599]：在当前作用域中，结构体`HashMap<String, i32>`没有名为`find`的方法",
  "regex": "error\\[E0599\\]: no method named `[a-zA-Z_][a-zA-Z0-9_]*` found for struct `[a-zA-Z_][a-zA-Z0-9_:<>]*` in the current scope",
  "domain": "rust",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Calling a method that doesn't exist on the type, often due to confusing the method name with another type (e.g., using `find` from iterators on a HashMap directly).",
  "root_cause_type": "generic",
  "root_cause_zh": "调用了该类型不存在的方法，通常是由于将方法名与另一种类型混淆（例如，在HashMap上直接使用迭代器的`find`方法）。",
  "versions": [
    {
      "version": "rustc 1.68.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rustc 1.72.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rustc 1.78.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "HashMap itself doesn't implement Iterator; you need to call `.iter()` first.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Dereferencing a HashMap doesn't give you an iterator; it gives you the inner type, which also doesn't have `find`.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "HashMap does not have a static `find` method; it's an iterator method.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Call `.iter()` on the HashMap to get an iterator, then use `.find()` on the iterator.",
      "success_rate": 0.95,
      "how": "Call `.iter()` on the HashMap to get an iterator, then use `.find()` on the iterator.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `HashMap::get` or `HashMap::contains_key` for key-based lookups instead of `find`.",
      "success_rate": 0.9,
      "how": "Use `HashMap::get` or `HashMap::contains_key` for key-based lookups instead of `find`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在HashMap上调用`.iter()`获取迭代器，然后在迭代器上使用`.find()`。",
    "使用`HashMap::get`或`HashMap::contains_key`进行基于键的查找，而不是使用`find`。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/error_codes/E0599.html",
  "official_doc_section": null,
  "error_code": "E0599",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-07-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}