@@ -320,7 +320,7 @@ pub fn build_impl(cx: &DocContext,
320
320
let type_scheme = tcx. lookup_item_type ( did) ;
321
321
let default = if assoc_const. has_value {
322
322
Some ( const_eval:: lookup_const_by_id ( tcx, did, None , None )
323
- . unwrap ( ) . span . to_src ( cx) )
323
+ . unwrap ( ) . 0 . span . to_src ( cx) )
324
324
} else {
325
325
None
326
326
} ;
@@ -462,15 +462,15 @@ fn build_const(cx: &DocContext, tcx: &TyCtxt,
462
462
use rustc:: middle:: const_eval;
463
463
use rustc_front:: print:: pprust;
464
464
465
- let expr = const_eval:: lookup_const_by_id ( tcx, did, None , None ) . unwrap_or_else ( || {
465
+ let ( expr, ty ) = const_eval:: lookup_const_by_id ( tcx, did, None , None ) . unwrap_or_else ( || {
466
466
panic ! ( "expected lookup_const_by_id to succeed for {:?}" , did) ;
467
467
} ) ;
468
468
debug ! ( "converting constant expr {:?} to snippet" , expr) ;
469
469
let sn = pprust:: expr_to_string ( expr) ;
470
470
debug ! ( "got snippet {}" , sn) ;
471
471
472
472
clean:: Constant {
473
- type_ : tcx. lookup_item_type ( did) . ty . clean ( cx) ,
473
+ type_ : ty . map ( |t| t . clean ( cx ) ) . unwrap_or_else ( || tcx. lookup_item_type ( did) . ty . clean ( cx) ) ,
474
474
expr : sn
475
475
}
476
476
}
0 commit comments