# Rust: error[E0271]: type mismatch resolving `<impl Iterator as Iterator>::Item == i32`

**Code:** `E0271: type mismatch resolving associated type` · **Category:** Rust · **Seen on:** Rust

A trait's associated type (Iterator::Item, Future::Output) doesn't match what's expected.

## Meaning

Check what your iterator/future actually yields (`&i32` vs `i32`, `Result<T,E>` vs `T`). Use `.copied()`/`.cloned()`/`.map(|x| *x)`, `?` on results, or adjust the bound `Iterator<Item = &i32>`. The message shows expected vs found.

## Common causes

- Iterator yields references but code expects values
- `Result` inside a stream/iterator not handled
- Future Output mismatch (`impl Future<Output = T>`)
- Closure returning another type than the bound
- `collect` into incompatible type

## Quick fix

1. Add `.copied()`/`.cloned()` or dereference
2. Handle `Result` items with `?`/`collect::<Result<Vec<_>,_>>()`
3. Adjust the trait bound's associated type

## Detailed fix by platform

### Rust

1. `let v: Vec<i32> = items.iter().copied().collect();`

## How to diagnose

1. **Item** — Yielded type?
2. **Expected** — Bound type?
3. **Adapter** — copied/cloned?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/rust/e0271-type-mismatch-resolving-associated-type)
