diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index 1329e945b..7998a2662 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -134,7 +134,7 @@ fn get_ufcs_type_name( if let Some(trait_id) = cx.tcx.trait_of_item(method_def_id) { if match_borrow_depth(expected_type_of_self, actual_type_of_self) { - return Some(cx.tcx.item_path_str(trait_id)); + return Some(cx.tcx.def_path_str(trait_id)); } } @@ -174,7 +174,7 @@ fn match_types(lhs: &ty::TyKind<'_>, rhs: &ty::TyKind<'_>) -> bool { fn get_type_name(cx: &LateContext<'_, '_>, kind: &ty::TyKind<'_>) -> String { match kind { - ty::Adt(t, _) => cx.tcx.item_path_str(t.did), + ty::Adt(t, _) => cx.tcx.def_path_str(t.did), ty::Ref(_, r, _) => get_type_name(cx, &r.sty), _ => kind.to_string(), } diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 7bd3fd7f4..74a85f1f8 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -539,7 +539,7 @@ fn check_wild_enum_match(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { String::new() }; // This path assumes that the enum type is imported into scope. - format!("{}{}{}", ident_str, cx.tcx.item_path_str(v.did), suffix) + format!("{}{}{}", ident_str, cx.tcx.def_path_str(v.did), suffix) }) .collect();