]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/default_trait_access.rs
default_trait_access skips <F as Default>::default()
[rust.git] / clippy_lints / src / default_trait_access.rs
index f01e106df2615e6415b41fb1d88c7a1bd26c40ca..d3598a5bdaae729416ac606e5019331b3bbaaad0 100644 (file)
@@ -48,6 +48,13 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
             then {
                 match qpath {
                     QPath::Resolved(..) => {
+                        if let ExprKind::Call(ref method, ref _args) = expr.node {
+                            if format!("{:?}", method).contains(" as Default>") {
+                                return
+                            }
+                        }
+
+
                         // TODO: Work out a way to put "whatever the imported way of referencing
                         // this type in this file" rather than a fully-qualified type.
                         let expr_ty = cx.tables.expr_ty(expr);