false positive in simple example of io::stdin::lines() #9135
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
Taking the basic example from the io::stdin::lines() documentation, I get clippy warnings about significant drops. I'm not sure if I understand certainly that it's a false positive, but it seems likely since I took the example from the rust documentation here: https://doc.rust-lang.org/std/io/struct.Stdin.html#method.lines
Sorry If I've mis-filed this, or just become overly confused.
Lint Name
clippy::significant_drop_in_scrutinee
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No clippy warning, or a clippy warning that makes more sense in context.
This is also available on the playground, here: https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=52eb4bd0d9fc3e2cace0cd54cd18da5c
It requires the beta clippy.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: