about summary refs log tree commit diff
path: root/clippy_lints/src
diff options
context:
space:
mode:
authorJason Newcomb <jsnewcomb@pm.me>2021-04-15 10:37:42 -0400
committerJason Newcomb <jsnewcomb@pm.me>2021-04-15 10:37:42 -0400
commit779d98f6ccbd76807e811a134bb00a4e0d92c6db (patch)
tree018cb396bb60478f7607c62c264c1f48ea646901 /clippy_lints/src
parentb1c675f3fc682201cdb28719133285b878e2d157 (diff)
downloadrust-779d98f6ccbd76807e811a134bb00a4e0d92c6db.tar.gz
rust-779d98f6ccbd76807e811a134bb00a4e0d92c6db.zip
Don't allow adjustments for `manual_map`
Diffstat (limited to 'clippy_lints/src')
-rw-r--r--clippy_lints/src/manual_map.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/clippy_lints/src/manual_map.rs b/clippy_lints/src/manual_map.rs
index 29be0739977..f16ed4104fe 100644
--- a/clippy_lints/src/manual_map.rs
+++ b/clippy_lints/src/manual_map.rs
@@ -104,12 +104,18 @@ impl LateLintPass<'_> for ManualMap {
                 None => return,
             };
 
+            // These two lints will go back and forth with each other.
             if cx.typeck_results().expr_ty(some_expr) == cx.tcx.types.unit
                 && !is_allowed(cx, OPTION_MAP_UNIT_FN, expr.hir_id)
             {
                 return;
             }
 
+            // `map` won't perform any adjustments.
+            if !cx.typeck_results().expr_adjustments(some_expr).is_empty() {
+                return;
+            }
+
             if !can_move_expr_to_closure(cx, some_expr) {
                 return;
             }