Report #74832
[bug\_fix] E0277: the trait bound \`T: Iterator\` is not satisfied
Add the missing trait bound to the generic parameter, e.g., \`fn process\(items: T\)\`. For concrete types, ensure you call the method that yields the iterator \(e.g., \`vec.iter\(\)\` instead of \`vec\`\).
Journey Context:
Developer writes a generic helper \`fn print\_all\(items: T\)\` and immediately tries to call \`items.next\(\)\`. The compiler throws E0277, noting that \`T\` doesn't implement \`Iterator\`. Developer initially tries to cast or turbofish, which fails. They realize generics require explicit trait bounds. After adding \`where T: Iterator\` or \`T: IntoIterator\`, the code compiles. If the input was a concrete \`Vec\`, they instead realize they forgot \`.iter\(\)\`, which returns an iterator implementing the trait.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:12:08.147069+00:00— report_created — created