jameysharp commented on issue #5473:
So this version requires anyone who wants to call the
jumpmethod to explicitlyusethe newInstBuilderDerivedtrait, right? We talked about trying to name the new traitInstBuilderand rename the auto-generated trait to something else. I take it that didn't work out?How about this: make the generated
inst_builder.rscontain only the method definitions, not the surroundingpub trait InstBuilderetc. Move thepub traitdeclaration to the hand-written code, so it can have hand-written methods in it, and stickinclude!(concat!(env!("OUT_DIR"), "/inst_builder.rs"));into the middle of that trait so all the generated methods are also in the same trait. Does that make this diff smaller?
elliottt commented on issue #5473:
So this version requires anyone who wants to call the
jumpmethod to explicitlyusethe newInstBuilderDerivedtrait, right? We talked about trying to name the new traitInstBuilderand rename the auto-generated trait to something else. I take it that didn't work out?I found that the previous
InstBuildermethods weren't available without importing it as well, which led me to give the derived functions a new name.How about this: make the generated
inst_builder.rscontain only the method definitions, not the surroundingpub trait InstBuilderetc. Move thepub traitdeclaration to the hand-written code, so it can have hand-written methods in it, and stickinclude!(concat!(env!("OUT_DIR"), "/inst_builder.rs"));into the middle of that trait so all the generated methods are also in the same trait. Does that make this diff smaller?I think that would make the diff smaller! The downside would be that we'd still need to manually port the documentation over for any hand-written wrappers, as the docs wouldn't be automatically generated for them. I think I'm going to try a different approach, and generate the version of the builder that takes the
Blockand&[Value]arguments separately back on #5464. That will avoid any issues of documentation sync, and should make it easy enough to generate multiple versions of the same function if necessary.
Last updated: Dec 06 2025 at 06:05 UTC