1

fix `iter_not_returning_iterator` by Jarcho · Pull Request #8228 · rust-lang/rus...

 2 years ago
source link: https://github.com/rust-lang/rust-clippy/pull/8228
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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

Collaborator

@giraffate giraffate 10 days ago

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

@Jarcho Jarcho 10 days ago

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 reacted with thumbs up emoji

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK