]> git.lizzy.rs Git - rust.git/commitdiff
Fix Repr output so that it does not ICE when a self-type is
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 13 Jan 2015 19:01:27 +0000 (14:01 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 14 Jan 2015 21:35:14 +0000 (16:35 -0500)
absent. This occurs while printing object type projections for
debugging (note that the `UserString` impl is much more careful about
this).

src/librustc/util/ppaux.rs

index 559ec533baa9eca1ed0a67d7bbca462541c5ad9f..c3b6c2178ee09a19a2ed485c01c08d5906a8a5e4 100644 (file)
@@ -1430,7 +1430,7 @@ fn user_string(&self, tcx: &ctxt<'tcx>) -> String {
 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))
     }