@@ -252,7 +252,7 @@ impl<C: AstFormatter> FmtWithCtx<C> for gast::Body {
252252 }
253253 Body :: TraitMethodWithoutDefault => write ! ( f, "= <method_without_default_body>" ) ,
254254 Body :: Extern ( name) => write ! ( f, "= <extern:{name}>" ) ,
255- Body :: Intrinsic ( name) => write ! ( f, "= <intrinsic:{name}>" ) ,
255+ Body :: Intrinsic { name, .. } => write ! ( f, "= <intrinsic:{name}>" ) ,
256256 Body :: Opaque => write ! ( f, "= <opaque>" ) ,
257257 Body :: Missing => write ! ( f, "= <missing>" ) ,
258258 Body :: Error ( error) => write ! ( f, "= error(\" {}\" )" , error. msg) ,
@@ -588,9 +588,19 @@ impl<C: AstFormatter> FmtWithCtx<C> for FunDecl {
588588 let arg_names = match & self . body {
589589 Body :: Unstructured ( body) => args_of_locals ( & body. locals ) ,
590590 Body :: Structured ( body) => args_of_locals ( & body. locals ) ,
591+ Body :: Intrinsic { arg_names, .. } => arg_names
592+ . iter ( )
593+ . enumerate ( )
594+ . map ( |( i, name) | {
595+ let id = LocalId :: new ( i + 1 ) ;
596+ match name {
597+ Some ( name) => format ! ( "{name}_{id}" ) ,
598+ None => format ! ( "_{id}" ) ,
599+ }
600+ } )
601+ . collect ( ) ,
591602 Body :: Error ( ..)
592603 | Body :: Extern ( ..)
593- | Body :: Intrinsic ( ..)
594604 | Body :: Missing
595605 | Body :: Opaque
596606 | Body :: TraitMethodWithoutDefault => ( 0 ..n_args)
0 commit comments