@@ -1197,8 +1197,8 @@ impl<'tcx> Debug for Rvalue<'tcx> {
11971197 ty:: tls:: with ( |tcx| {
11981198 let variant_def = & tcx. adt_def ( adt_did) . variant ( variant) ;
11991199 let args = tcx. lift ( args) . expect ( "could not lift for printing" ) ;
1200- let name = FmtPrinter :: print_string ( tcx, Namespace :: ValueNS , |cx | {
1201- cx . print_def_path ( variant_def. def_id , args)
1200+ let name = FmtPrinter :: print_string ( tcx, Namespace :: ValueNS , |p | {
1201+ p . print_def_path ( variant_def. def_id , args)
12021202 } ) ?;
12031203
12041204 match variant_def. ctor_kind ( ) {
@@ -1473,9 +1473,9 @@ impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
14731473 } ;
14741474
14751475 let fmt_valtree = |cv : & ty:: Value < ' tcx > | {
1476- let mut cx = FmtPrinter :: new ( self . tcx , Namespace :: ValueNS ) ;
1477- cx . pretty_print_const_valtree ( * cv, /*print_ty*/ true ) . unwrap ( ) ;
1478- cx . into_buffer ( )
1476+ let mut p = FmtPrinter :: new ( self . tcx , Namespace :: ValueNS ) ;
1477+ p . pretty_print_const_valtree ( * cv, /*print_ty*/ true ) . unwrap ( ) ;
1478+ p . into_buffer ( )
14791479 } ;
14801480
14811481 let val = match const_ {
@@ -1967,10 +1967,10 @@ fn pretty_print_const_value_tcx<'tcx>(
19671967 . expect ( "destructed mir constant of adt without variant idx" ) ;
19681968 let variant_def = & def. variant ( variant_idx) ;
19691969 let args = tcx. lift ( args) . unwrap ( ) ;
1970- let mut cx = FmtPrinter :: new ( tcx, Namespace :: ValueNS ) ;
1971- cx . print_alloc_ids = true ;
1972- cx . print_value_path ( variant_def. def_id , args) ?;
1973- fmt. write_str ( & cx . into_buffer ( ) ) ?;
1970+ let mut p = FmtPrinter :: new ( tcx, Namespace :: ValueNS ) ;
1971+ p . print_alloc_ids = true ;
1972+ p . print_value_path ( variant_def. def_id , args) ?;
1973+ fmt. write_str ( & p . into_buffer ( ) ) ?;
19741974
19751975 match variant_def. ctor_kind ( ) {
19761976 Some ( CtorKind :: Const ) => { }
@@ -2001,18 +2001,18 @@ fn pretty_print_const_value_tcx<'tcx>(
20012001 }
20022002 }
20032003 ( ConstValue :: Scalar ( scalar) , _) => {
2004- let mut cx = FmtPrinter :: new ( tcx, Namespace :: ValueNS ) ;
2005- cx . print_alloc_ids = true ;
2004+ let mut p = FmtPrinter :: new ( tcx, Namespace :: ValueNS ) ;
2005+ p . print_alloc_ids = true ;
20062006 let ty = tcx. lift ( ty) . unwrap ( ) ;
2007- cx . pretty_print_const_scalar ( scalar, ty) ?;
2008- fmt. write_str ( & cx . into_buffer ( ) ) ?;
2007+ p . pretty_print_const_scalar ( scalar, ty) ?;
2008+ fmt. write_str ( & p . into_buffer ( ) ) ?;
20092009 return Ok ( ( ) ) ;
20102010 }
20112011 ( ConstValue :: ZeroSized , ty:: FnDef ( d, s) ) => {
2012- let mut cx = FmtPrinter :: new ( tcx, Namespace :: ValueNS ) ;
2013- cx . print_alloc_ids = true ;
2014- cx . print_value_path ( * d, s) ?;
2015- fmt. write_str ( & cx . into_buffer ( ) ) ?;
2012+ let mut p = FmtPrinter :: new ( tcx, Namespace :: ValueNS ) ;
2013+ p . print_alloc_ids = true ;
2014+ p . print_value_path ( * d, s) ?;
2015+ fmt. write_str ( & p . into_buffer ( ) ) ?;
20162016 return Ok ( ( ) ) ;
20172017 }
20182018 // FIXME(oli-obk): also pretty print arrays and other aggregate constants by reading
0 commit comments