Fix Repr output so that it does not ICE when a self-type is

absent. This occurs while printing object type projections for
debugging (note that the `UserString` impl is much more careful about
this).
This commit is contained in:
Niko Matsakis 2015-01-13 14:01:27 -05:00
parent 02aacaba8f
commit b92ec6a78a

View File

@ -1430,7 +1430,7 @@ impl<'tcx> UserString<'tcx> for ty::ProjectionPredicate<'tcx> {
impl<'tcx> Repr<'tcx> for ty::ProjectionTy<'tcx> {
fn repr(&self, tcx: &ctxt<'tcx>) -> String {
format!("<{} as {}>::{}",
self.trait_ref.self_ty().repr(tcx),
self.trait_ref.substs.self_ty().repr(tcx),
self.trait_ref.repr(tcx),
self.item_name.repr(tcx))
}