{
  "id": "rust/e0599-no-method-found-for-option",
  "signature": "error[E0599]: no method named `unwrap_or_else` found for struct `std::option::Option<T>` in the current scope",
  "signature_zh": "错误[E0599]: 在当前作用域中未找到结构体 `std::option::Option<T>` 的方法 `unwrap_or_else`",
  "regex": "error\\[E0599\\]: no method named .* found for (struct|enum|union) .* in the current scope",
  "domain": "rust",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Method name typo or attempting to call a method that doesn't exist on the type, often due to missing trait import or incorrect method name.",
  "root_cause_type": "generic",
  "root_cause_zh": "方法名称拼写错误，或尝试调用类型上不存在的方法，通常是由于缺少 trait 导入或方法名不正确。",
  "versions": [
    {
      "version": "1.65.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.72.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.80.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding a 'use' statement for the wrong module — e.g., 'use std::option::Option::unwrap_or_else;' which doesn't exist.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Renaming the variable to match a different type with the method — this changes semantics and may break other code.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the correct method name. For Option, use 'unwrap_or_else' (with underscore, not 'unwraporelse'). Example: 'let x = opt.unwrap_or_else(|| default_val);'",
      "success_rate": 0.95,
      "how": "Check the correct method name. For Option, use 'unwrap_or_else' (with underscore, not 'unwraporelse'). Example: 'let x = opt.unwrap_or_else(|| default_val);'",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the method is from a trait (e.g., 'Iterator'), ensure the trait is in scope: 'use std::iter::Iterator;'",
      "success_rate": 0.9,
      "how": "If the method is from a trait (e.g., 'Iterator'), ensure the trait is in scope: 'use std::iter::Iterator;'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check the correct method name. For Option, use 'unwrap_or_else' (with underscore, not 'unwraporelse'). Example: 'let x = opt.unwrap_or_else(|| default_val);'",
    "If the method is from a trait (e.g., 'Iterator'), ensure the trait is in scope: 'use std::iter::Iterator;'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/stable/error_codes/E0599.html",
  "official_doc_section": null,
  "error_code": "E0599",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}