@@ -6,7 +6,7 @@ use clippy_utils::usage::{local_used_after_expr, local_used_in};
6
6
use clippy_utils:: { higher, is_adjusted, path_to_local, path_to_local_id} ;
7
7
use rustc_errors:: Applicability ;
8
8
use rustc_hir:: def_id:: DefId ;
9
- use rustc_hir:: { BindingAnnotation , Expr , ExprKind , FnRetTy , Param , PatKind , TyKind , Unsafety } ;
9
+ use rustc_hir:: { BindingAnnotation , Expr , ExprKind , FnRetTy , Param , PatKind , QPath , TyKind , Unsafety } ;
10
10
use rustc_infer:: infer:: TyCtxtInferExt ;
11
11
use rustc_lint:: { LateContext , LateLintPass } ;
12
12
use rustc_middle:: ty:: subst:: { GenericArg , GenericArgKind } ;
@@ -120,16 +120,8 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
120
120
121
121
match body. value . kind {
122
122
ExprKind :: Call ( callee, args)
123
- if matches ! ( callee. kind, ExprKind :: Path ( .. ) ) =>
123
+ if matches ! ( callee. kind, ExprKind :: Path ( QPath :: Resolved ( .. ) | QPath :: TypeRelative ( .. ) ) ) =>
124
124
{
125
- if matches ! ( higher:: Range :: hir( body. value) , Some ( higher:: Range {
126
- start: Some ( _) ,
127
- end: Some ( _) ,
128
- limits: rustc_ast:: RangeLimits :: Closed
129
- } ) ) {
130
- return ;
131
- }
132
-
133
125
let callee_ty = typeck. expr_ty ( callee) . peel_refs ( ) ;
134
126
if matches ! (
135
127
type_diagnostic_name( cx, callee_ty) ,
0 commit comments