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

@ -1,6 +1,6 @@
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir::def_id::CrateNum;
use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData};
use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData};
use rustc_middle::ich::NodeIdHashingMode;
use rustc_middle::mir::interpret::{ConstValue, Scalar};
use rustc_middle::ty::print::{PrettyPrinter, Print, Printer};
@ -316,10 +316,8 @@ impl Printer<'tcx> for SymbolPrinter<'tcx> {
self.path.finalize_pending_component();
}
match disambiguated_data.data.get_name() {
DefPathDataName::Named(name) => self.write_str(&name.as_str())?,
DefPathDataName::Anon { namespace } => write!(self, "{{{{{}}}}}", namespace)?,
}
write!(self, "{}", disambiguated_data.data)?;
Ok(self)
}
fn path_generic_args(