@@ -24,7 +24,8 @@ use crate::context::GlobalCtx;
2424use crate :: def:: dummy_param_name;
2525use crate :: def:: is_dummy_param_name;
2626use crate :: def:: {
27- Spanned , positional_field_ident, prefix_tuple_param, prefix_tuple_variant, user_local_name,
27+ Spanned , impl_fndef_path, positional_field_ident, prefix_tuple_param, prefix_tuple_variant,
28+ user_local_name,
2829} ;
2930use crate :: messages:: Span ;
3031use crate :: messages:: { error, internal_error} ;
@@ -1049,17 +1050,10 @@ fn add_fndef_axioms_to_function(
10491050 Arc :: new ( TypX :: Datatype ( tuple_dt, Arc :: new ( arg_typs) , Arc :: new ( vec ! [ ] ) ) ) ;
10501051 let trait_typ_args = Arc :: new ( vec ! [ self_typ, args_tuple_typ] ) ;
10511052
1052- let mk_impl_path = |kind : ClosureKind | {
1053- Arc :: new ( crate :: ast:: PathX {
1054- krate : CrateId :: Internal ,
1055- segments : Arc :: new ( vec ! [ crate :: def:: impl_fndef( & function. x. name, kind) ] ) ,
1056- } )
1057- } ;
1058-
10591053 let mut trait_impls_out: Vec < TraitImpl > = Vec :: new ( ) ;
10601054 for kind in [ ClosureKind :: Fn , ClosureKind :: FnMut , ClosureKind :: FnOnce ] {
10611055 let trait_implx = crate :: ast:: TraitImplX {
1062- impl_path : mk_impl_path ( kind) ,
1056+ impl_path : impl_fndef_path ( & function . x . name , kind) ,
10631057 typ_params : function. x . typ_params . clone ( ) ,
10641058 typ_bounds : function. x . typ_bounds . clone ( ) ,
10651059 trait_path : kind. trait_path ( ) ,
@@ -1074,7 +1068,7 @@ fn add_fndef_axioms_to_function(
10741068
10751069 let assoc_typ_implx = crate :: ast:: AssocTypeImplX {
10761070 name : Arc :: new ( "Output" . to_string ( ) ) ,
1077- impl_path : mk_impl_path ( ClosureKind :: FnOnce ) ,
1071+ impl_path : impl_fndef_path ( & function . x . name , ClosureKind :: FnOnce ) ,
10781072 typ_params : function. x . typ_params . clone ( ) ,
10791073 typ_bounds : function. x . typ_bounds . clone ( ) ,
10801074 trait_path : ClosureKind :: FnOnce . trait_path ( ) ,
0 commit comments