@@ -1197,8 +1197,8 @@ impl<'tcx> Debug for Rvalue<'tcx> {
1197
1197
ty:: tls:: with ( |tcx| {
1198
1198
let variant_def = & tcx. adt_def ( adt_did) . variant ( variant) ;
1199
1199
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)
1202
1202
} ) ?;
1203
1203
1204
1204
match variant_def. ctor_kind ( ) {
@@ -1473,9 +1473,9 @@ impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
1473
1473
} ;
1474
1474
1475
1475
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 ( )
1479
1479
} ;
1480
1480
1481
1481
let val = match const_ {
@@ -1967,10 +1967,10 @@ fn pretty_print_const_value_tcx<'tcx>(
1967
1967
. expect ( "destructed mir constant of adt without variant idx" ) ;
1968
1968
let variant_def = & def. variant ( variant_idx) ;
1969
1969
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 ( ) ) ?;
1974
1974
1975
1975
match variant_def. ctor_kind ( ) {
1976
1976
Some ( CtorKind :: Const ) => { }
@@ -2001,18 +2001,18 @@ fn pretty_print_const_value_tcx<'tcx>(
2001
2001
}
2002
2002
}
2003
2003
( 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 ;
2006
2006
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 ( ) ) ?;
2009
2009
return Ok ( ( ) ) ;
2010
2010
}
2011
2011
( 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 ( ) ) ?;
2016
2016
return Ok ( ( ) ) ;
2017
2017
}
2018
2018
// FIXME(oli-obk): also pretty print arrays and other aggregate constants by reading
0 commit comments