Why do I get the "identical conversion" clippy lint in a for loop?

Hi, I get the identical conversion clippy lint in the following for loop:

for (m, board) in determine_all_moves(board)? {
    println!("Moves: {:?}, board: {}", m, board);
}

where

fn determine_all_moves<T: ...>(board: T) -> Result<Vec<..>, PacoError>

Is that a false positive or am I missing something?

Not enough information to tell, what is it highlighting for the lint? Nothing you have shown looks like it would trigger it.

Bildschirmfoto%20vom%202019-06-14%2021-54-16

That seems weird, I don't know what is triggering clippy. I don't see any into, from, or into_iter, which are the only things which would trigger it.

There's one implicitly in the desugaring of expr? (which is precicely what the span points to), but the lint shouldn't be firing there...

Then I'll try to reduce it to a minimal example and submit a clippy issue later.

Try the latest nightly, if this recently added test case tells us anything...

https://github.com/rust-lang/rust-clippy/commit/a5bcaf538d193f9e502b122875f9d54ca3dfdaa1

2 Likes

Yes, running the latest nightly clippy does indeed fix the issue.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.