-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Remove IteratorExt #23300
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
Remove IteratorExt #23300
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -200,7 +147,7 @@ pub trait IteratorExt: Iterator + Sized { | |||
/// ``` | |||
#[inline] | |||
#[stable(feature = "rust1", since = "1.0.0")] | |||
fn nth(&mut self, mut n: usize) -> Option<Self::Item> { | |||
fn nth(&mut self, mut n: usize) -> Option<Self::Item> where Self: Sized { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that functions like this which can relax the Self: Sized
bound are ok to. In theory an iterator could override this method to provide a specialized implementation.
I'm ok merging this as-is basically (nit or not), so r=me once the ICE is fixed |
☔ The latest upstream changes (presumably #23342) made this pull request unmergeable. Please resolve the merge conflicts. |
@sfackler I'm investigating ICE now... |
OK, I... sort of understand the ICE. The problem is constructing the vtable for an |
see #23435 for a smaller example and explanation of the ICE |
#23438 should fix the ICE |
Awesome, thanks Niko! |
Rebased over @nikomatsakis's fix, but it looks like we're still running into a very similar crash: https://gist.github.com/sfackler/6bf9e4140c1890553528 |
05aac06
to
1848548
Compare
Backtrace:
|
@sfackler hmm! I'll check it out again... |
@sfackler ok I have a fix for the ICE now, but I don't have a good standalone test case yet. The problem seems to arise because I was previously trying to normalize first, when normalization itself can encounter errors. |
☔ The latest upstream changes (presumably #23482) made this pull request unmergeable. Please resolve the merge conflicts. |
1848548
to
0b0ebb9
Compare
This works rebased on top of #23486 so it should be good to go once that merges. |
@@ -928,7 +885,7 @@ pub trait IteratorExt: Iterator + Sized { | |||
/// `std::usize::MAX` elements of the original iterator. | |||
#[inline] | |||
#[stable(feature = "rust1", since = "1.0.0")] | |||
fn rev(self) -> Rev<Self> { | |||
fn rev(self) -> Rev<Self> where Self: Sized { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this where Self: Sized + DoubleEndedIterator
in order to fix #23587?
0b0ebb9
to
8d574c8
Compare
8d574c8
to
11f5ac6
Compare
@bors r=alexcrichton 11f5ac6 |
⌛ Testing commit 11f5ac6 with merge 2f4bad9... |
💔 Test failed - auto-win-64-nopt-t |
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
11f5ac6
to
d502f42
Compare
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change] This is blocked on ICEs: https://gist.github.com/sfackler/5aff7c57cf8d896e2c6f Seem to be similar to #23281.
All methods are inlined into Iterator with
Self: Sized
bounds to makesure Iterator is still object safe.
[breaking-change]
This is blocked on ICEs: https://gist.github.com/sfackler/5aff7c57cf8d896e2c6f
Seem to be similar to #23281.