# error[E0308]: mismatched types -- expected `impl Future<Output = ()>`, found `()`

- **ID:** `rust/e0308-mismatched-types-async`
- **Domain:** rust
- **Category:** type_error
- **Error Code:** `E0308`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

An async function or block is returning a value directly instead of returning a Future, often due to missing 'async' keyword or incorrect return type.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.65.0 | active | — | — |
| 1.72.0 | active | — | — |
| 1.80.0 | active | — | — |

## Workarounds

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

## Dead Ends

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