Skip to content

Added Self where possible in LinkedList (updated) #30893

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

Closed
wants to merge 5 commits into from
Closed

Added Self where possible in LinkedList (updated) #30893

wants to merge 5 commits into from

Conversation

cmlsharp
Copy link

Updated pull request

@gankro

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@cmlsharp cmlsharp changed the title Aded Self where possible Aded Self where possible (updated) Jan 14, 2016
@@ -898,9 +898,9 @@ impl<T> IntoIterator for LinkedList<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> IntoIterator for &'a LinkedList<T> {
type Item = &'a T;
type IntoIter = Iter<'a, T>;
type IntoIter = Iter<'a, Self::IntoIter>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have still been T, and is causing infinite recursion in type checking.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I meant to type Self::Item

@Gankra
Copy link
Contributor

Gankra commented Jan 17, 2016

rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections
src/libcollections/linked_list.rs:899:1: 906:2 error: type mismatch resolving `<linked_list::Iter<'_, &T> as core::iter::Iterator>::Item == &T`:
 expected &-ptr,
    found type parameter [E0271]
src/libcollections/linked_list.rs:899 impl<'a, T> IntoIterator for &'a LinkedList<T> {
src/libcollections/linked_list.rs:900     type Item = &'a T;
src/libcollections/linked_list.rs:901     type IntoIter = Iter<'a, Self::Item>;
src/libcollections/linked_list.rs:902 
src/libcollections/linked_list.rs:903     fn into_iter(self) -> Self::IntoIter {
src/libcollections/linked_list.rs:904         self.iter()
                                      ...
src/libcollections/linked_list.rs:899:1: 906:2 help: run `rustc --explain E0271` to see a detailed explanation
src/libcollections/linked_list.rs:899:1: 906:2 note: required by `core::iter::IntoIterator`
error: aborting due to previous error
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.collections] Error 101

@Gankra
Copy link
Contributor

Gankra commented Jan 17, 2016

Iter<'a, T>, not Iter<'a, &T>

@brson
Copy link
Contributor

brson commented Jan 20, 2016

r? @gankro

@rust-highfive rust-highfive assigned Gankra and unassigned brson Jan 20, 2016
@bluss
Copy link
Member

bluss commented Feb 22, 2016

Thanks, this looks good. Can you please squash together all the commits?

A reviewer can r=me when the squash is done.

@bluss bluss assigned bluss and unassigned Gankra Feb 22, 2016
@bluss
Copy link
Member

bluss commented Feb 22, 2016

Like oli-obk said, there's no notification for new commits or pushes, so a message in the PR thread is good way to notify those subscribed to the PR.

@bluss bluss changed the title Aded Self where possible (updated) Added Self where possible in LinkedList (updated) Feb 22, 2016
@cyplo
Copy link
Contributor

cyplo commented Apr 30, 2016

Hello ! Is this one still relevant ? If so - is there anything blocking it from getting merged ? thanks !

@mrhota
Copy link
Contributor

mrhota commented May 23, 2016

@crossroads1112 if you're short on time, I can re-open this into another PR and squash these commits for you. Let me know.

@bluss
Copy link
Member

bluss commented Jun 17, 2016

Thanks so much @crossroads1112, I will close this PR for inactivity, but you (or anyone else) are welcome to submit this change again.

@bluss bluss closed this Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants