{
  "id": "rust/e0133-unused-unsafe",
  "signature": "error[E0133]: call to unsafe function is unsafe and requires unsafe block",
  "signature_zh": "错误[E0133]: 调用不安全函数是不安全的，需要 unsafe 块",
  "regex": "error\\[E0133\\]: call to unsafe function .* is unsafe and requires unsafe block",
  "domain": "rust",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Calling a function marked as 'unsafe' without wrapping it in an 'unsafe {}' block.",
  "root_cause_type": "generic",
  "root_cause_zh": "调用了标记为 'unsafe' 的函数，但没有将其包裹在 'unsafe {}' 块中。",
  "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 'unsafe' to the function signature instead of wrapping the call in a block — this changes the function's contract but doesn't fix the call site.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using '#[allow(unsafe_code)]' lint suppression — this only silences the warning, not the error, and doesn't make the code compile.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Wrap the unsafe call in an 'unsafe { ... }' block. Example: 'unsafe { std::ptr::read(ptr); }'",
      "success_rate": 0.95,
      "how": "Wrap the unsafe call in an 'unsafe { ... }' block. Example: 'unsafe { std::ptr::read(ptr); }'",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the function has a safe wrapper, use that instead. E.g., use 'std::slice::from_raw_parts' via safe abstractions.",
      "success_rate": 0.85,
      "how": "If the function has a safe wrapper, use that instead. E.g., use 'std::slice::from_raw_parts' via safe abstractions.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Wrap the unsafe call in an 'unsafe { ... }' block. Example: 'unsafe { std::ptr::read(ptr); }'",
    "If the function has a safe wrapper, use that instead. E.g., use 'std::slice::from_raw_parts' via safe abstractions."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/stable/error_codes/E0133.html",
  "official_doc_section": null,
  "error_code": "E0133",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-11-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}