@@ -468,19 +468,13 @@ fn clean_middle_term<'tcx>(
468468fn clean_hir_term < ' tcx > (
469469 assoc_item : Option < DefId > ,
470470 term : & hir:: Term < ' tcx > ,
471- span : rustc_span:: Span ,
472471 cx : & mut DocContext < ' tcx > ,
473472) -> Term {
474473 match term {
475474 hir:: Term :: Ty ( ty) => Term :: Type ( clean_ty ( ty, cx) ) ,
476475 hir:: Term :: Const ( c) => {
477- let ty = if let Some ( assoc_item) = assoc_item {
478- // FIXME(generic_const_items): this should instantiate with the alias item's args
479- cx. tcx . type_of ( assoc_item) . instantiate_identity ( )
480- } else {
481- Ty :: new_error_with_message ( cx. tcx , span, "cannot find the associated constant" )
482- } ;
483-
476+ // FIXME(generic_const_items): this should instantiate with the alias item's args
477+ let ty = cx. tcx . type_of ( assoc_item. unwrap ( ) ) . instantiate_identity ( ) ;
484478 let ct = lower_const_arg_for_rustdoc ( cx. tcx , c, ty) ;
485479 Term :: Constant ( clean_middle_const ( ty:: Binder :: dummy ( ct) , cx) )
486480 }
@@ -3164,9 +3158,7 @@ fn clean_assoc_item_constraint<'tcx>(
31643158 . associated_items ( trait_did)
31653159 . find_by_ident_and_kind ( cx. tcx , constraint. ident , assoc_tag, trait_did)
31663160 . map ( |item| item. def_id ) ;
3167- AssocItemConstraintKind :: Equality {
3168- term : clean_hir_term ( assoc_item, term, constraint. span , cx) ,
3169- }
3161+ AssocItemConstraintKind :: Equality { term : clean_hir_term ( assoc_item, term, cx) }
31703162 }
31713163 hir:: AssocItemConstraintKind :: Bound { bounds } => AssocItemConstraintKind :: Bound {
31723164 bounds : bounds. iter ( ) . filter_map ( |b| clean_generic_bound ( b, cx) ) . collect ( ) ,
0 commit comments