]> git.lizzy.rs Git - rust.git/commitdiff
MIR-dump: print return type from local_decls for `_0`
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 7 Nov 2017 09:29:10 +0000 (04:29 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 16 Nov 2017 10:57:46 +0000 (05:57 -0500)
We've kind of got the same information twice in the MIR, between the
return-type field and the local-decls. Seems un-great.

src/librustc_mir/util/pretty.rs

index 5dc7a324c2d4511f78fc7ae86bf33d43b35d5178..e71f4fbef26539c28e0ddab2ee67b4cbb0d9b3a6 100644 (file)
@@ -348,7 +348,7 @@ pub fn write_mir_intro<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
     let indented_retptr = format!("{}let mut {:?}: {};",
                                   INDENT,
                                   RETURN_POINTER,
-                                  mir.return_ty);
+                                  mir.local_decls[RETURN_POINTER].ty);
     writeln!(w, "{0:1$} // return pointer",
              indented_retptr,
              ALIGN)?;