//@ known-bug: #131342 // see also: 131342.rs fn main() { problem_thingy(Once); } struct Once; impl Iterator for Once { type Item = (); } fn problem_thingy(items: impl Iterator) { let peeker = items.peekable(); problem_thingy(&peeker); } trait Iterator { type Item; fn peekable(self) -> Peekable where Self: Sized, { loop {} } } struct Peekable { _peeked: I::Item, } impl Iterator for Peekable { type Item = I::Item; } impl Iterator for &I { type Item = I::Item; }