{
  "id": "rust/e0599-no-method-named-parse-found",
  "signature": "error[E0599]: no method named `parse` found for struct `String` in the current scope",
  "signature_zh": "错误[E0599]：在当前作用域中未找到 `String` 结构体上的 `parse` 方法",
  "regex": "error\\[E0599\\]: no method named `parse` found for struct `String`",
  "domain": "rust",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Calling `.parse()` on a String without importing the `FromStr` trait or providing a type annotation for the result.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 String 上调用 `.parse()` 时没有导入 `FromStr` trait 或为结果提供类型注解。",
  "versions": [
    {
      "version": "1.65",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.70",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.75",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding `use std::str::FromStr;` but not specifying the target type",
      "why_fails": "The parse method requires type inference; without a type hint, the compiler cannot determine the output type.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using `as` cast: `my_string as u32`",
      "why_fails": "String cannot be cast to numeric types with `as`; only primitive numeric types can be cast.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a type annotation to the result: `let num: u32 = my_string.parse().unwrap();`",
      "success_rate": 0.95,
      "how": "Add a type annotation to the result: `let num: u32 = my_string.parse().unwrap();`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use turbofish syntax: `my_string.parse::<u32>().unwrap();`",
      "success_rate": 0.95,
      "how": "Use turbofish syntax: `my_string.parse::<u32>().unwrap();`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Explicitly call `FromStr::from_str`: `u32::from_str(&my_string).unwrap();`",
      "success_rate": 0.9,
      "how": "Explicitly call `FromStr::from_str`: `u32::from_str(&my_string).unwrap();`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add a type annotation to the result: `let num: u32 = my_string.parse().unwrap();`",
    "Use turbofish syntax: `my_string.parse::<u32>().unwrap();`",
    "Explicitly call `FromStr::from_str`: `u32::from_str(&my_string).unwrap();`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/error-index.html#E0599",
  "official_doc_section": null,
  "error_code": "E0599",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-06-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}