# 错误[E0133]: 调用不安全函数是不安全的，需要 unsafe 块

- **ID:** `rust/e0133-unused-unsafe`
- **领域:** rust
- **类别:** type_error
- **错误码:** `E0133`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

调用了标记为 'unsafe' 的函数，但没有将其包裹在 'unsafe {}' 块中。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.65.0 | active | — | — |
| 1.72.0 | active | — | — |
| 1.80.0 | active | — | — |

## 解决方案

1. ```
   Wrap the unsafe call in an 'unsafe { ... }' block. Example: 'unsafe { std::ptr::read(ptr); }'
   ```
2. ```
   If the function has a safe wrapper, use that instead. E.g., use 'std::slice::from_raw_parts' via safe abstractions.
   ```

## 无效尝试

- **** — 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. (70% 失败率)
- **** — Using '#[allow(unsafe_code)]' lint suppression — this only silences the warning, not the error, and doesn't make the code compile. (90% 失败率)
