# 错误[E0308]: 类型不匹配 —— 期望 `impl Future<Output = ()>`，找到 `()`

- **ID:** `rust/e0308-mismatched-types-async`
- **领域:** rust
- **类别:** type_error
- **错误码:** `E0308`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

异步函数或块直接返回了一个值，而不是返回一个 Future，通常是由于缺少 'async' 关键字或返回类型不正确。

## 版本兼容性

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

## 解决方案

1. ```
   Add 'async' keyword to the function definition: 'async fn my_func() -> () { /* ... */ }'. This wraps the return value in a Future.
   ```
2. ```
   If the function must return a Future manually, change return type to 'Pin<Box<dyn Future<Output = ()>>>' and return 'Box::pin(async move { ... })'.
   ```

## 无效尝试

- **** — Adding '.await' at the call site without making the calling function async — this causes a different error about 'await' outside async context. (80% 失败率)
- **** — Returning a 'Box::pin(future)' without adjusting the return type — still mismatched type. (60% 失败率)
