File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use clippy_utils::path_res;
33use clippy_utils:: source:: snippet;
44use clippy_utils:: ty:: implements_trait;
55use rustc_errors:: Applicability ;
6- use rustc_hir:: def:: { DefKind , Res } ;
6+ use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
77use rustc_hir:: def_id:: DefId ;
88use rustc_hir:: { Expr , ExprKind , QPath } ;
99use rustc_lint:: { LateContext , LateLintPass } ;
@@ -68,7 +68,8 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPathNew<'tcx> {
6868
6969 let ( fn_did, args) = match e. kind {
7070 ExprKind :: Call ( callee, args)
71- if let Res :: Def ( DefKind :: Fn | DefKind :: AssocFn , did) = path_res ( cx, callee) =>
71+ if let Res :: Def ( DefKind :: Fn | DefKind :: AssocFn | DefKind :: Ctor ( _, CtorKind :: Fn ) , did) =
72+ path_res ( cx, callee) =>
7273 {
7374 ( did, args)
7475 } ,
You can’t perform that action at this time.
0 commit comments