-
Notifications
You must be signed in to change notification settings - Fork 0
DoubleEndedIterator
implementation causes overflow libcore build
#88
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
DoubleEndedIterator
implementation causes overflow libcore build
Ah, it has to do with the blanket impl trait Iterator {
type Item;
fn next(&mut self) -> Option<Self::Item>;
}
trait IntoIterator {
type IntoIter: Iterator<Item = Self::Item>;
type Item;
}
/* Uncomment this to make it fail:
impl<I: Iterator> IntoIterator for I {
type Item = I::Item;
type IntoIter = I;
}
*/
trait DoubleEndedIterator: Iterator {
fn next_back(&mut self) -> Option<Self::Item>;
}
struct Foo<U>(U);
impl<U> Iterator for Foo<U> where U: IntoIterator {
type Item = U::Item;
fn next(&mut self) -> Option<Self::Item> { todo!() }
}
impl<U> DoubleEndedIterator for Foo<U>
where
U: IntoIterator,
<U as IntoIterator>::IntoIter: DoubleEndedIterator,
{
fn next_back(&mut self) -> Option<U::Item> {
todo!()
}
}
fn main() {} |
🤔 is this #76? |
jup, it's #76 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Uh oh!
There was an error while loading. Please reload this page.
Minimized when trying to build core:
I think it's because the solver is having trouble projecting
<<U as IntoIterator>::IntoIter as Iterator>::Item
into<U as IntoIterator>::Item
. It should be possible to do that via this item boundtype IntoIter: Iterator<Item = Self::Item>
.The text was updated successfully, but these errors were encountered: