@@ -43,7 +43,7 @@ use rustc_hir::PredicateOrigin;
43
43
use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
44
44
use rustc_hir:: def_id:: { DefId , DefIdMap , DefIdSet , LOCAL_CRATE , LocalDefId } ;
45
45
use rustc_hir_analysis:: hir_ty_lowering:: FeedConstTy ;
46
- use rustc_hir_analysis:: { lower_const_arg , lower_ty} ;
46
+ use rustc_hir_analysis:: { lower_const_arg_for_rustdoc , lower_ty} ;
47
47
use rustc_middle:: metadata:: Reexport ;
48
48
use rustc_middle:: middle:: resolve_bound_vars as rbv;
49
49
use rustc_middle:: ty:: { self , AdtKind , GenericArgsRef , Ty , TyCtxt , TypeVisitableExt , TypingMode } ;
@@ -437,7 +437,7 @@ fn clean_hir_term<'tcx>(term: &hir::Term<'tcx>, cx: &mut DocContext<'tcx>) -> Te
437
437
match term {
438
438
hir:: Term :: Ty ( ty) => Term :: Type ( clean_ty ( ty, cx) ) ,
439
439
hir:: Term :: Const ( c) => {
440
- let ct = lower_const_arg ( cx. tcx , c, FeedConstTy :: No ) ;
440
+ let ct = lower_const_arg_for_rustdoc ( cx. tcx , c, FeedConstTy :: No ) ;
441
441
Term :: Constant ( clean_middle_const ( ty:: Binder :: dummy ( ct) , cx) )
442
442
}
443
443
}
@@ -625,8 +625,9 @@ fn clean_generic_param<'tcx>(
625
625
hir:: GenericParamKind :: Const { ty, default, synthetic } => {
626
626
( param. name . ident ( ) . name , GenericParamDefKind :: Const {
627
627
ty : Box :: new ( clean_ty ( ty, cx) ) ,
628
- default : default
629
- . map ( |ct| Box :: new ( lower_const_arg ( cx. tcx , ct, FeedConstTy :: No ) . to_string ( ) ) ) ,
628
+ default : default. map ( |ct| {
629
+ Box :: new ( lower_const_arg_for_rustdoc ( cx. tcx , ct, FeedConstTy :: No ) . to_string ( ) )
630
+ } ) ,
630
631
synthetic,
631
632
} )
632
633
}
@@ -1813,7 +1814,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1813
1814
// `const_eval_poly` tries to first substitute generic parameters which
1814
1815
// results in an ICE while manually constructing the constant and using `eval`
1815
1816
// does nothing for `ConstKind::Param`.
1816
- let ct = lower_const_arg ( cx. tcx , const_arg, FeedConstTy :: No ) ;
1817
+ let ct = lower_const_arg_for_rustdoc ( cx. tcx , const_arg, FeedConstTy :: No ) ;
1817
1818
let ct = if let hir:: ConstArgKind :: Anon ( hir:: AnonConst { def_id, .. } ) =
1818
1819
const_arg. kind
1819
1820
{
0 commit comments