2023-09-06 23:51:36 -05:00
|
|
|
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);
|
2023-09-07 01:57:08 -05:00
|
|
|
//~^ ERROR `&dyn IntoIterator<IntoIter = I, Item = i32>` is not an iterator
|
2023-09-06 23:51:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|