-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix iter_not_returning_iterator
#8228
Conversation
…n the implementation
r? @giraffate (rust-highfive has picked a reviewer for you, use r? to override) |
66d77a3
to
d98339d
Compare
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; |
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.
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.
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.
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.
@bors r+ Thanks! |
📌 Commit d98339d has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #8225
changelog: Handle type projections in
iter_not_returning_iterator
changelog: Don't lint
iter_not_returning_iterator
in trait implementationschangelog: Lint
iter_not_returning_iterator
in trait definitions