1
Fork 0

Implement Display for DisambiguatedDefPathData and DefPathData

This commit is contained in:
marmeladema 2020-08-31 22:57:48 +01:00
parent f1878d19fa
commit 9f50c49117
5 changed files with 33 additions and 58 deletions

View file

@ -1002,11 +1002,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId) -> String {
let def_id = map.local_def_id(id);
tcx.def_path_str(def_id.to_def_id())
} else if let Some(path) = map.def_path_from_hir_id(id) {
path.data
.into_iter()
.map(|elem| elem.data.to_string())
.collect::<Vec<_>>()
.join("::")
path.data.into_iter().map(|elem| elem.to_string()).collect::<Vec<_>>().join("::")
} else {
String::from("<missing path>")
}