- if match_trait_method(cx, e, &paths::TRY_INTO_TRAIT) && &*name.ident.as_str() == "try_into" {
- if_chain! {
- let a = cx.tables().expr_ty(e);
- let b = cx.tables().expr_ty(&args[0]);
- if is_type_diagnostic_item(cx, a, sym!(result_type));
- if let ty::Adt(_, substs) = a.kind;
- if let Some(a_type) = substs.types().next();
- if TyS::same_type(a_type, b);
+ if_chain! {
+ if is_trait_method(cx, e, sym::try_into_trait) && 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 let ty::Adt(_, substs) = a.kind();
+ if let Some(a_type) = substs.types().next();
+ if same_type_and_consts(a_type, b);