- let mut unique_type_id = String::with_capacity(256);
- unique_type_id.push('{');
-
- match type_.sty {
- ty::TyNever |
- ty::TyBool |
- ty::TyChar |
- ty::TyStr |
- ty::TyInt(_) |
- ty::TyUint(_) |
- ty::TyFloat(_) => {
- push_debuginfo_type_name(cx, type_, false, &mut unique_type_id);
- },
- ty::TyAdt(def, substs) => {
- unique_type_id.push_str(&(String::from(def.descr()) + " "));
- from_def_id_and_substs(self, cx, def.did, substs, &mut unique_type_id);
- }
- ty::TyTuple(component_types) if component_types.is_empty() => {
- push_debuginfo_type_name(cx, type_, false, &mut unique_type_id);
- },
- ty::TyTuple(component_types) => {
- unique_type_id.push_str("tuple ");
- for &component_type in component_types {
- let component_type_id =
- self.get_unique_type_id_of_type(cx, component_type);
- let component_type_id =
- self.get_unique_type_id_as_string(component_type_id);
- unique_type_id.push_str(&component_type_id[..]);
- }
- },
- ty::TyBox(inner_type) => {
- unique_type_id.push_str("box ");
- let inner_type_id = self.get_unique_type_id_of_type(cx, inner_type);
- let inner_type_id = self.get_unique_type_id_as_string(inner_type_id);
- unique_type_id.push_str(&inner_type_id[..]);
- },
- ty::TyRawPtr(ty::TypeAndMut { ty: inner_type, mutbl } ) => {
- unique_type_id.push('*');
- if mutbl == hir::MutMutable {
- unique_type_id.push_str("mut");
- }