about summary refs log tree commit diff
path: root/clippy_lints/src/map_clone.rs
AgeCommit message (Collapse)AuthorLines
2020-01-13Rustup to rust-lang/rust#68045Yuki Okushi-1/+1
2020-01-11Rustup to rust-lang/rust#67806Yuki Okushi-3/+2
2020-01-07Normalize lint messagesYuki Okushi-1/+1
2020-01-07Rustup to rust-lang/rust#67886Yuki Okushi-1/+1
2020-01-04Rustup to https://github.com/rust-lang/rust/pull/67853Philipp Hansch-1/+1
Specifically caused by https://github.com/rust-lang/rust/pull/67786
2019-12-27Rustup to rust-lang/rust#66936Yuki Okushi-2/+2
2019-12-22Fix `map_clone` false positiveMichael Wright-2/+4
Don't lint when the item type is not a reference. `copied` only applies to references.
2019-12-04Rustup to rust-lang/rust#66878Matthias Krüger-1/+2
2019-09-27Rustup to rust-lang/rust#64813flip1995-6/+6
2019-09-26Rustup https://github.com/rust-lang/rust/pull/64513Lzu Tao-1/+1
2019-08-28Replace `Arg` with `Param`Yuki Okushi-1/+1
2019-08-19Remove in_macro_or_desugarKRAAI, MATTHEW [VISUS]-3/+2
2019-05-17Prevent symbocalypseOliver Scherer-2/+2
2019-05-14Use symbols instead of stringsOliver Scherer-2/+2
2019-05-11Rename in_macro to in_macro_or_desugarManish Goregaokar-2/+3
2019-04-28Suggest .copied() for map_clone on iterators tooManish Goregaokar-7/+4
2019-04-17Use lint pass macrosMatthew Kraai-14/+3
Fixes #3917.
2019-04-15Only suggest .copied() for Option right nowManish Goregaokar-5/+8
2019-04-15Also suggest .copied() when .clone() is called on a Copy typeManish Goregaokar-3/+4
2019-04-15Suggest .copied() instead of .cloned() in map_clone when dealing with referencesManish Goregaokar-16/+31
2019-03-05move lint documentation into macro invocationsAndy Russell-22/+22
2019-02-03Fix breakage due to rust-lang/rust#58079Michael Wright-2/+2
The rustc change added HirId to a few nodes. As I understand it, the plan is to remove the NodeId from these nodes eventually. Where the NodeId was not being matched, I used `..` to try and avoid further breakage. Where it was, I used `_` to make the fix easier when NodeId is removed.
2019-01-27rustup https://github.com/rust-lang/rust/pull/57726Matthias Krüger-0/+4
2019-01-15Remove `map_clone` fixed known problemMichael Wright-3/+1
2019-01-15Fix `map_clone` bad suggestionMichael Wright-21/+46
`cloned` requires that the elements of the iterator must be references. This change determines if that is the case by examining the type of the closure argument and suggesting `.cloned` only if it is a reference. When the closure argument is not a reference, it suggests removing the `map` call instead. A minor problem with this change is that the new check sometimes overlaps with the `clone_on_copy` lint. Fixes #498
2019-01-08Remove all copyright license headersPhilipp Hansch-9/+0
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2018-12-29Remove crate:: prefixes from crate pathsKonrad Borowski-6/+6
This is somewhat misleading, as those are actually external crates, and don't need a crate:: prefix.
2018-12-22Document map_clone known problems #498Vlad-Shcherbina-1/+3
(cherry picked from commit ada0d2c54831a904a53ff4106e0ebb6a0f06a687)
2018-12-08rustup https://github.com/rust-lang/rust/pull/56502 ( .hir -> .hir() )Matthias Krüger-1/+1
2018-11-27Fix some formatting issuesflip1995-1/+1
2018-11-27Run rustfmt on clippy_lintsflip1995-9/+24
2018-11-27Add applicability level to (nearly) every span_lint_and_sugg functionflip1995-3/+4
2018-11-27Add Applicability::Unspecified to span_lint_and_sugg functionsflip1995-6/+4
2018-10-08Don't suggest cloned() for map Box derefRyan Cumming-1/+1
Boxes are a bit magic in that they need to use `*` to get an owned value out of the box. They implement `Deref` but that only returns a reference. This means an easy way to convert an `Option<Box<T>>` to an `<Option<T>` is: ``` box_option.map(|b| *b) ``` However, since b36bb0a6 the `map_clone` lint is detecting this as an attempt to copy the box. Fix by excluding boxes completely from the deref part of this lint. Fixes #3274
2018-10-06Add license header to Rust filesManish Goregaokar-0/+10
2018-10-02Trailing newlineOliver Schneider-1/+1
2018-10-02FIx dogfoodOliver Schneider-4/+2
2018-10-02Reimplement the `map_clone` lint from scratchOliver Schneider-0/+100
2018-10-02relicensing: Remove map_cloneManish Goregaokar-140/+0
This removes the code added in https://github.com/rust-lang-nursery/rust-clippy/pull/427
2018-09-15Reintroduce `extern crate` for non-Cargo dependencies.Eduard-Mihai Burtescu-5/+5
2018-08-29Switch to declare_tool_lint macroflip1995-1/+1
2018-08-28Update imports and rustupOliver Schneider-1/+1
2018-08-22rustup, fix breakage introduced by https://github.com/rust-lang/rust/pull/53581Matthias Krüger-1/+1
2018-07-23RustupOliver Schneider-3/+3
2018-07-20Remove import of if_chainManish Goregaokar-0/+1
2018-07-19Remove import of rustcManish Goregaokar-0/+1
2018-07-16ExprKindcsmoe-6/+6
2018-07-15Ignore spans when comparing expressionsOliver Schneider-5/+5
2018-06-29RustupMateusz Mikuła-7/+7
2018-06-25Resolve field, struct and function renamingflip1995-1/+1
Addresses the errors produced by (re)moving, merging or renaming structs, fields and methods by rust-lang/rust#48149 and rust-lang/rust#51580