File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2416,6 +2416,14 @@ impl Clean<Type> for hir::Ty {
24162416 Array ( box ty. clean ( cx) , length)
24172417 } ,
24182418 TyKind :: Tup ( ref tys) => Tuple ( tys. clean ( cx) ) ,
2419+ TyKind :: Def ( item_id, _) => {
2420+ let item = cx. tcx . hir . expect_item ( item_id. id ) ;
2421+ if let hir:: ItemKind :: Existential ( ref ty) = item. node {
2422+ ImplTrait ( ty. bounds . clean ( cx) )
2423+ } else {
2424+ unreachable ! ( )
2425+ }
2426+ }
24192427 TyKind :: Path ( hir:: QPath :: Resolved ( None , ref path) ) => {
24202428 if let Some ( new_ty) = cx. ty_substs . borrow ( ) . get ( & path. def ) . cloned ( ) {
24212429 return new_ty;
@@ -2425,14 +2433,6 @@ impl Clean<Type> for hir::Ty {
24252433 if let Some ( bounds) = cx. impl_trait_bounds . borrow_mut ( ) . remove ( & did) {
24262434 return ImplTrait ( bounds) ;
24272435 }
2428- } else if let Def :: Existential ( did) = path. def {
2429- // This block is for returned impl trait only.
2430- if let Some ( node_id) = cx. tcx . hir . as_local_node_id ( did) {
2431- let item = cx. tcx . hir . expect_item ( node_id) ;
2432- if let hir:: ItemKind :: Existential ( ref ty) = item. node {
2433- return ImplTrait ( ty. bounds . clean ( cx) ) ;
2434- }
2435- }
24362436 }
24372437
24382438 let mut alias = None ;
You can’t perform that action at this time.
0 commit comments