@@ -817,13 +817,12 @@ pub fn pretty_print_input(sess: Session,
817
817
& id,
818
818
resolve:: MakeGlobMap :: No ,
819
819
|tcx, mir_map, _, _| {
820
- let mir_map = mir_map. unwrap ( ) ;
821
-
822
- for ( nodeid , mir ) in & mir_map . map {
823
- try!( writeln ! ( out , "MIR for {}" , tcx . map . node_to_string ( * nodeid ) ) ) ;
824
- try! ( write_mir_pretty ( mir , & mut out ) ) ;
820
+ if let Some ( mir_map) = mir_map {
821
+ for ( nodeid , mir ) in & mir_map . map {
822
+ try! ( writeln ! ( out , "MIR for {}" , tcx . map. node_to_string ( * nodeid ) ) ) ;
823
+ try!( write_mir_pretty ( mir , & mut out ) ) ;
824
+ }
825
825
}
826
-
827
826
Ok ( ( ) )
828
827
} ) , & sess)
829
828
}
@@ -840,12 +839,14 @@ pub fn pretty_print_input(sess: Session,
840
839
& id,
841
840
resolve:: MakeGlobMap :: No ,
842
841
|tcx, mir_map, _, _| {
843
- let mir_map = mir_map. unwrap ( ) ;
844
- try!( writeln ! ( out, "MIR for {}" , tcx. map. node_to_string( nodeid) ) ) ;
845
- let mir = mir_map. map . get ( & nodeid) . unwrap_or_else ( || {
846
- sess. fatal ( & format ! ( "no MIR map entry for node {}" , nodeid) )
847
- } ) ;
848
- write_mir_pretty ( mir, & mut out)
842
+ if let Some ( mir_map) = mir_map {
843
+ try!( writeln ! ( out, "MIR for {}" , tcx. map. node_to_string( nodeid) ) ) ;
844
+ let mir = mir_map. map . get ( & nodeid) . unwrap_or_else ( || {
845
+ sess. fatal ( & format ! ( "no MIR map entry for node {}" , nodeid) )
846
+ } ) ;
847
+ try!( write_mir_pretty ( mir, & mut out) ) ;
848
+ }
849
+ Ok ( ( ) )
849
850
} ) , & sess)
850
851
}
851
852
0 commit comments