Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for extra linked list methods #27794

Closed
alexcrichton opened this issue Aug 13, 2015 · 7 comments · Fixed by #74644 or #79834
Closed

Tracking issue for extra linked list methods #27794

alexcrichton opened this issue Aug 13, 2015 · 7 comments · Fixed by #74644 or #79834
Labels
A-collections Area: `std::collection` B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. Libs-Small Libs issues that are considered "small" or self-contained Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

This is a tracking issue for the unstable linked_list_extras methods in the standard library.

cc @gankro, perhaps you can fill this in some more? The specific methods in question are:

  • IterMut::insert_next
  • IterMut::peek_next
@alexcrichton alexcrichton added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. B-unstable Blocker: Implemented in the nightly compiler and unstable. labels Aug 13, 2015
@Gankra
Copy link
Contributor

Gankra commented Aug 13, 2015

This is basically a lame version of cursors, which is what we should use instead imo. It's not 1:1 though -- this api lets you have all the elements yielded at once. Classic iterator tradeoff.

@steveklabnik
Copy link
Member

Triage: these are still unstable.

@Mark-Simulacrum Mark-Simulacrum added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Jul 22, 2017
@dtolnay
Copy link
Member

dtolnay commented Nov 16, 2017

There are some ideas for a more complete IterMut API in #39148 (comment).

@dtolnay
Copy link
Member

dtolnay commented Nov 16, 2017

IterMut::peek_next seems misnamed. Doesn't it do exactly what we call peek() elsewhere?

@Amanieu
Copy link
Member

Amanieu commented Nov 16, 2017

I'm going to echo @gankro's thoughts:

This is basically a lame version of cursors, which is what we should use instead imo.

An iterator conceptually represents a (double-ended) range of elements. The only operation that it supports is popping an element off the end of that range.

A cursor on the other hand represents a position in a collection, and can be moved backwards or forwards in the collection. The cursor can be used to insert or remove an element at any given position in the collection.

I strongly oppose adding insertion/deleting methods to IterMut since they do not fit at all with existing iterator usage patterns (for loops and functional-style methods).

As I mentioned in the linked thread, a design based on the Cursor and CursotMut types in intrusive-collections could be used.

@Dylan-DPC-zz Dylan-DPC-zz added the B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. label Nov 15, 2019
@jonas-schievink jonas-schievink added the A-collections Area: `std::collection` label Jan 31, 2020
@Amanieu
Copy link
Member

Amanieu commented Apr 5, 2020

Since we now have cursors, I think these methods should be removed.

@KodrAus KodrAus added I-nominated Libs-Small Libs issues that are considered "small" or self-contained Libs-Tracked Libs issues that are tracked on the team's project board. labels Jul 29, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 31, 2020
Remove `linked_list_extras` methods.

Removing these in favor of the `Cursor` API in rust-lang#58533 .
Closes rust-lang#27794.

r? @Amanieu
@bors bors closed this as completed in ab4570e Aug 1, 2020
@Amanieu
Copy link
Member

Amanieu commented Aug 1, 2020

Reopening since we only deprecated the methods instead of removing them. I'd say give it about 2 weeks then remove them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-collections Area: `std::collection` B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. Libs-Small Libs issues that are considered "small" or self-contained Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
10 participants