// Tests that the compiler suggests an `into_iter` call when an `Iterator` method // is called on something that implements `IntoIterator` fn main() { let items = items(); let other_items = items.map(|i| i + 1); //~^ ERROR no method named `map` found for opaque type `impl IntoIterator` in the current scope let vec: Vec = items.collect(); //~^ ERROR no method named `collect` found for opaque type `impl IntoIterator` in the current scope } fn items() -> impl IntoIterator { vec![1, 2, 3] } fn process(items: impl IntoIterator) -> Vec { items.collect() //~^ ERROR no method named `collect` found for type parameter `impl IntoIterator` in the current scope }