-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
map_clone
suggests removing clone altogether
#6239
Comments
|
Gotcha, thanks. It should still suggest |
@rustbot modify labels: +A-suggestion +L-suggestion-causes-error |
Actually I think this is still wrong - |
I can fix this. |
Improve doc about `map_clone` A follow up of #6239 (comment). `map_clone` works with not only `Iterator` but `Option` although not written in [doc](https://rust-lang.github.io/rust-clippy/master/#map_clone). Also, an example in the doc shows a usage of dereferencing, but this isn't also written. changelog: Improve doc about `map_clone`
I tried this code (https://github.com/rust-lang/rust/blob/a6ff925f8b5598a1f6d84964525baa1d4a08fd63/compiler/rustc_codegen_ssa/src/back/write.rs#L1026):
I expected to see this happen: Not sure this lint should have fired in the first place? This is a
Ref
, not an iterator.Instead, this happened: Clippy suggests removing the map altogether, giving a type error.
Meta
cargo clippy -V
: clippy 0.0.212 (ffa2e7a 2020-10-24)The text was updated successfully, but these errors were encountered: