diff --git a/clippy_lints/src/methods/needless_option_take.rs b/clippy_lints/src/methods/needless_option_take.rs index 57a43ff606a..297d83e9e37 100644 --- a/clippy_lints/src/methods/needless_option_take.rs +++ b/clippy_lints/src/methods/needless_option_take.rs @@ -10,7 +10,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, recv: &'tcx Expr<'_>) { // Checks if expression type is equal to sym::Option and if the expr is not a syntactic place - if is_expr_option(cx, expr) && !expr.is_syntactic_place_expr() { + if is_expr_option(cx, recv) && !recv.is_syntactic_place_expr() { let mut applicability = Applicability::MachineApplicable; span_lint_and_sugg( cx,