-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
iter_not_returning_iterator falsely positiving on every method named iter #8285
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Comments
dtolnay
added
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
labels
Jan 15, 2022
Mentioning @Jarcho @giraffate who touched this lint recently. |
dtolnay
added a commit
to dtolnay/syn
that referenced
this issue
Jan 15, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/data.rs:79:5 | 79 | pub fn iter(&self) -> punctuated::Iter<Field> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator error: this method is named `iter_mut` but its return type does not implement `Iterator` --> src/data.rs:90:5 | 90 | pub fn iter_mut(&mut self) -> punctuated::IterMut<Field> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator error: this method is named `iter` but its return type does not implement `Iterator` --> src/punctuated.rs:105:5 | 105 | pub fn iter(&self) -> Iter<T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator error: this method is named `iter_mut` but its return type does not implement `Iterator` --> src/punctuated.rs:116:5 | 116 | pub fn iter_mut(&mut self) -> IterMut<T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
dtolnay
added a commit
to dtolnay/serde-yaml
that referenced
this issue
Jan 15, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/mapping.rs:123:5 | 123 | pub fn iter(&self) -> Iter { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator error: this method is named `iter_mut` but its return type does not implement `Iterator` --> src/mapping.rs:132:5 | 132 | pub fn iter_mut(&mut self) -> IterMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
dtolnay
added a commit
to dtolnay/path-to-error
that referenced
this issue
Jan 15, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/path.rs:27:5 | 27 | pub fn iter(&self) -> Segments { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
dtolnay
added a commit
to dtolnay/trybuild
that referenced
this issue
Jan 15, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/diff.rs:76:9 | 76 | pub fn iter(&self, _input: &str) -> Box<dyn Iterator<Item = Render>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
dtolnay
added a commit
to serde-rs/json
that referenced
this issue
Jan 15, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/map.rs:238:5 | 238 | pub fn iter(&self) -> Iter { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator error: this method is named `iter_mut` but its return type does not implement `Iterator` --> src/map.rs:246:5 | 246 | pub fn iter_mut(&mut self) -> IterMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
dtolnay
added a commit
to dtolnay/cargo-tally
that referenced
this issue
Jan 15, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/matrix.rs:37:5 | 37 | pub fn iter(&self) -> Iter { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
ronaldslc
pushed a commit
to ronaldslc/serde-json
that referenced
this issue
Dec 3, 2022
rust-lang/rust-clippy#8285 error: this method is named `iter` but its return type does not implement `Iterator` --> src/map.rs:238:5 | 238 | pub fn iter(&self) -> Iter { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::iter-not-returning-iterator` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator error: this method is named `iter_mut` but its return type does not implement `Iterator` --> src/map.rs:246:5 | 246 | pub fn iter_mut(&mut self) -> IterMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
As of most recent nightly, and as of current master of clippy (7a4acf9), I haven't found a function named
iter
oriter_mut
which does not trigger this lint. Even if the function returns an implementation ofIterator
the lint triggers.Lint Name
iter_not_returning_iterator
Reproducer
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: