-}
-
-fn match_types(lhs: Ty<'_>, rhs: Ty<'_>) -> bool {
- match (&lhs.kind, &rhs.kind) {
- (ty::Bool, ty::Bool)
- | (ty::Char, ty::Char)
- | (ty::Int(_), ty::Int(_))
- | (ty::Uint(_), ty::Uint(_))
- | (ty::Str, ty::Str) => true,
- (ty::Ref(_, t1, mut1), ty::Ref(_, t2, mut2)) => mut1 == mut2 && match_types(t1, t2),
- (ty::Array(t1, _), ty::Array(t2, _)) | (ty::Slice(t1), ty::Slice(t2)) => match_types(t1, t2),
- (ty::Adt(def1, _), ty::Adt(def2, _)) => def1 == def2,
- (_, _) => false,
- }
-}
-
-fn get_type_name(cx: &LateContext<'_>, ty: Ty<'_>) -> String {
- match ty.kind {
- ty::Adt(t, _) => cx.tcx.def_path_str(t.did),
- ty::Ref(_, r, _) => get_type_name(cx, &r),
- _ => ty.to_string(),