![](/style/images/good.png)
![](/style/images/bad.png)
fix `iter_not_returning_iterator` by Jarcho · Pull Request #8228 · rust-lang/rus...
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;
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.
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.
Recommend
-
8
Copy link Contributor Jarcho commented...
-
6
Copy link Contributor Jarcho commented...
-
5
Copy link Contributor Jarcho comme...
-
2
Provided methodsReturns the bounds on the remaining length of the iterator. Specifically, size_hint() returns a tuple where the first element is the lower bound, and the second element is the upper bound....
-
3
Copy link Contributor Patrick-Poitras ...
-
3
New issue Erase late bound regions in iter_not_returning_iterator #8287
-
6
Rust Iterator pattern with iter(), into_iter() and iter_mut() methods Let's create a vec of integers, iterate through and print the individual values, and then afterward, print out the whole vec. Here is the code:
-
5
fix into_iter on ZST #101237 ...
-
6
Contributor ...
-
3
Conversation Contributor Closes...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK