@@ -35,6 +35,7 @@ enum ReachedType {
3535 Float ( u32 ) ,
3636 SpecFn ( usize ) ,
3737 Datatype ( Dt ) ,
38+ FnDef ( Fun , Vec < ReachedType > ) ,
3839 StrSlice ,
3940 Array ,
4041 Primitive ,
@@ -131,7 +132,9 @@ fn typ_to_reached_type(typ: &Typ) -> ReachedType {
131132 TypX :: AnonymousClosure ( ..) => ReachedType :: None ,
132133 TypX :: Datatype ( dt, _, _) => ReachedType :: Datatype ( dt. clone ( ) ) ,
133134 TypX :: Dyn ( ..) => ReachedType :: None ,
134- TypX :: FnDef ( ..) => ReachedType :: None ,
135+ TypX :: FnDef ( fun, typs, _) => {
136+ ReachedType :: FnDef ( fun. clone ( ) , typs. iter ( ) . map ( typ_to_reached_type) . collect ( ) )
137+ }
135138 TypX :: Decorate ( _, _, t) => typ_to_reached_type ( t) ,
136139 TypX :: Boxed ( t) => typ_to_reached_type ( t) ,
137140 TypX :: TypParam ( _) => ReachedType :: None ,
@@ -309,9 +312,11 @@ fn reach_typ(ctxt: &Ctxt, state: &mut State, typ: &Typ) {
309312 reach_assoc_type_decl ( ctxt, state, & ( trait_path. clone ( ) , name. clone ( ) ) ) ;
310313 // let visitor handle self_typ, trait_typ_args
311314 }
312- TypX :: FnDef ( fun, _typs , res_fun_opt) => {
315+ TypX :: FnDef ( fun, typs , res_fun_opt) => {
313316 state. fndef_types . insert ( fun. clone ( ) ) ;
314317 reach_function ( ctxt, state, fun) ;
318+ let typ_args: Vec < ReachedType > = typs. iter ( ) . map ( typ_to_reached_type) . collect ( ) ;
319+ reach_type ( ctxt, state, & ReachedType :: FnDef ( fun. clone ( ) , typ_args) ) ;
315320
316321 if let Some ( res_fun) = res_fun_opt {
317322 state. fndef_types . insert ( res_fun. clone ( ) ) ;
0 commit comments