rust/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.rs
2023-09-07 06:57:08 +00:00

16 lines
293 B
Rust

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() {}