]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/useless_conversion.rs
Rollup merge of #87528 - :stack_overflow_obsd, r=joshtriplett
[rust.git] / src / tools / clippy / clippy_lints / src / useless_conversion.rs
index 2861b43291901dfe493443d2e576d6dbd7ffea38..88f11542072b849e7920c3893fb0bf0ce713ac49 100644 (file)
@@ -63,7 +63,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
             },
 
             ExprKind::MethodCall(name, .., args, _) => {
-                if is_trait_method(cx, e, sym::into_trait) && &*name.ident.as_str() == "into" {
+                if is_trait_method(cx, e, sym::Into) && &*name.ident.as_str() == "into" {
                     let a = cx.typeck_results().expr_ty(e);
                     let b = cx.typeck_results().expr_ty(&args[0]);
                     if same_type_and_consts(a, b) {
@@ -103,10 +103,10 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
                     }
                 }
                 if_chain! {
-                    if is_trait_method(cx, e, sym::try_into_trait) && name.ident.name == sym::try_into;
+                    if is_trait_method(cx, e, sym::TryInto) && name.ident.name == sym::try_into;
                     let a = cx.typeck_results().expr_ty(e);
                     let b = cx.typeck_results().expr_ty(&args[0]);
-                    if is_type_diagnostic_item(cx, a, sym::result_type);
+                    if is_type_diagnostic_item(cx, a, sym::Result);
                     if let ty::Adt(_, substs) = a.kind();
                     if let Some(a_type) = substs.types().next();
                     if same_type_and_consts(a_type, b);
@@ -134,7 +134,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
                         let b = cx.typeck_results().expr_ty(&args[0]);
                         if_chain! {
                             if match_def_path(cx, def_id, &paths::TRY_FROM);
-                            if is_type_diagnostic_item(cx, a, sym::result_type);
+                            if is_type_diagnostic_item(cx, a, sym::Result);
                             if let ty::Adt(_, substs) = a.kind();
                             if let Some(a_type) = substs.types().next();
                             if same_type_and_consts(a_type, b);