Skip to content

Commit 3959ca3

Browse files
committed
fix rustdoc
1 parent d7d3920 commit 3959ca3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clean/inline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn build_impl(cx: &DocContext,
320320
let type_scheme = tcx.lookup_item_type(did);
321321
let default = if assoc_const.has_value {
322322
Some(const_eval::lookup_const_by_id(tcx, did, None, None)
323-
.unwrap().span.to_src(cx))
323+
.unwrap().0.span.to_src(cx))
324324
} else {
325325
None
326326
};
@@ -462,15 +462,15 @@ fn build_const(cx: &DocContext, tcx: &TyCtxt,
462462
use rustc::middle::const_eval;
463463
use rustc_front::print::pprust;
464464

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(|| {
466466
panic!("expected lookup_const_by_id to succeed for {:?}", did);
467467
});
468468
debug!("converting constant expr {:?} to snippet", expr);
469469
let sn = pprust::expr_to_string(expr);
470470
debug!("got snippet {}", sn);
471471

472472
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)),
474474
expr: sn
475475
}
476476
}

0 commit comments

Comments
 (0)