use the type name as the pass name

This commit is contained in:
Ariel Ben-Yehuda 2016-06-09 00:16:35 +03:00 committed by Ariel Ben-Yehuda
parent 065a264976
commit f5b1ba6e90
13 changed files with 12 additions and 27 deletions

View file

@ -28,6 +28,7 @@
#![feature(box_syntax)]
#![feature(collections)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(enumset)]
#![feature(iter_arith)]
#![feature(libc)]

View file

@ -76,7 +76,9 @@ pub trait Pass {
fn dep_node(&self, def_id: DefId) -> DepNode<DefId> {
DepNode::MirPass(def_id)
}
fn name(&self) -> &str;
fn name(&self) -> &str {
unsafe { ::std::intrinsics::type_name::<Self>() }
}
fn disambiguator<'a>(&'a self) -> Option<Box<fmt::Display+'a>> { None }
}