do not dump extern def-ids with path for now

This commit is contained in:
Niko Matsakis 2015-10-16 20:18:37 -04:00
parent a1e2a5538a
commit 60ab57e56d

View File

@ -61,12 +61,16 @@ impl fmt::Debug for DefId {
// Unfortunately, there seems to be no way to attempt to print
// a path for a def-id, so I'll just make a best effort for now
// and otherwise fallback to just printing the crate/node pair
try!(ty::tls::with_opt(|opt_tcx| {
if let Some(tcx) = opt_tcx {
try!(write!(f, " => {}", tcx.item_path_str(*self)));
}
Ok(())
}));
if self.is_local() { // (1)
// (1) side-step fact that not all external things have paths at
// the moment, such as type parameters
try!(ty::tls::with_opt(|opt_tcx| {
if let Some(tcx) = opt_tcx {
try!(write!(f, " => {}", tcx.item_path_str(*self)));
}
Ok(())
}));
}
write!(f, " }}")
}