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

fix iter_not_returning_iterator #8228

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Jan 5, 2022

fixes #8225

changelog: Handle type projections in iter_not_returning_iterator
changelog: Don't lint iter_not_returning_iterator in trait implementations
changelog: Lint iter_not_returning_iterator in trait definitions

@rust-highfive
Copy link

r? @giraffate

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 5, 2022
@Jarcho Jarcho force-pushed the iter_not_returning_iterator_8225 branch from 66d77a3 to d98339d Compare January 5, 2022 22:19
error: this method is named `iter` but its return type does not implement `Iterator`
--> $DIR/iter_not_returning_iterator.rs:50:5
|
LL | fn iter(&self) -> Self::I;
Copy link
Contributor

Choose a reason for hiding this comment

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

From the issue it looks like false positive, is this fixed? I tried the case described in the issue, but it seems that I am still warned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error occurs in a different spot. Before it errored on the trait impl, now it errors on the trait def. The trait def in the issue does not restrict the type in the trait so this is correct. The following test checks if the projection is correctly resolved to a type implementing Iterator.

Either fix would have fixed the fp in the issue.

@giraffate
Copy link
Contributor

@bors r+

Thanks!

@bors
Copy link
Collaborator

bors commented Jan 10, 2022

📌 Commit d98339d has been approved by giraffate

@bors
Copy link
Collaborator

bors commented Jan 10, 2022

⌛ Testing commit d98339d with merge b66dbe8...

@bors
Copy link
Collaborator

bors commented Jan 10, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: giraffate
Pushing b66dbe8 to master...

@bors bors merged commit b66dbe8 into rust-lang:master Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FP iter_not_returning_iterator with associated type
4 participants