@@ -6,7 +6,7 @@ use clippy_utils::usage::{local_used_after_expr, local_used_in};
66use clippy_utils:: { higher, is_adjusted, path_to_local, path_to_local_id} ;
77use rustc_errors:: Applicability ;
88use 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 } ;
1010use rustc_infer:: infer:: TyCtxtInferExt ;
1111use rustc_lint:: { LateContext , LateLintPass } ;
1212use rustc_middle:: ty:: subst:: { GenericArg , GenericArgKind } ;
@@ -120,16 +120,8 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
120120
121121 match body. value . kind {
122122 ExprKind :: Call ( callee, args)
123- if matches ! ( callee. kind, ExprKind :: Path ( .. ) ) =>
123+ if matches ! ( callee. kind, ExprKind :: Path ( QPath :: Resolved ( .. ) | QPath :: TypeRelative ( .. ) ) ) =>
124124 {
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-
133125 let callee_ty = typeck. expr_ty ( callee) . peel_refs ( ) ;
134126 if matches ! (
135127 type_diagnostic_name( cx, callee_ty) ,
0 commit comments