rust/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.rs

16 lines
293 B
Rust
Raw Normal View History

fn use_iterator<I>(itr: I)
where
I: IntoIterator<Item = i32>,
{
}
fn pass_iterator<I>(i: &dyn IntoIterator<Item = i32, IntoIter = I>)
where
I: Iterator<Item = i32>,
{
use_iterator(i);
//~^ ERROR `&dyn IntoIterator<IntoIter = I, Item = i32>` is not an iterator
}
fn main() {}