@@ -4,7 +4,6 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
44use clippy_utils:: msrvs:: { self , Msrv } ;
55use clippy_utils:: res:: MaybeDef ;
66use clippy_utils:: source:: snippet;
7- use clippy_utils:: ty:: get_type_diagnostic_name;
87use rustc_errors:: Applicability ;
98use rustc_hir as hir;
109use rustc_hir:: ExprKind :: Assign ;
@@ -251,7 +250,7 @@ fn match_acceptable_sym(cx: &LateContext<'_>, collect_def_id: DefId) -> bool {
251250
252251fn match_acceptable_type ( cx : & LateContext < ' _ > , expr : & hir:: Expr < ' _ > , msrv : Msrv ) -> bool {
253252 let ty = cx. typeck_results ( ) . expr_ty ( expr) . peel_refs ( ) ;
254- let required = match get_type_diagnostic_name ( cx, ty ) {
253+ let required = match ty . opt_diag_name ( cx) {
255254 Some ( sym:: BinaryHeap ) => msrvs:: BINARY_HEAP_RETAIN ,
256255 Some ( sym:: BTreeSet ) => msrvs:: BTREE_SET_RETAIN ,
257256 Some ( sym:: BTreeMap ) => msrvs:: BTREE_MAP_RETAIN ,
@@ -265,7 +264,7 @@ fn match_acceptable_type(cx: &LateContext<'_>, expr: &hir::Expr<'_>, msrv: Msrv)
265264
266265fn match_map_type ( cx : & LateContext < ' _ > , expr : & hir:: Expr < ' _ > ) -> bool {
267266 let ty = cx. typeck_results ( ) . expr_ty ( expr) . peel_refs ( ) ;
268- matches ! ( get_type_diagnostic_name ( cx, ty ) , Some ( sym:: BTreeMap | sym:: HashMap ) )
267+ matches ! ( ty . opt_diag_name ( cx) , Some ( sym:: BTreeMap | sym:: HashMap ) )
269268}
270269
271270fn make_span_lint_and_sugg ( cx : & LateContext < ' _ > , span : Span , sugg : String ) {
0 commit comments