The function is given in the error message:
_ZN112_$LT$solana_program..instruction..InstructionError$u20$as$u20$solana_frozen_abi..abi_example..AbiEnumVisitor$GT$13visit_for_abi17h14ef924a4ab59970E
And if you run that through rustfilt
to demangle it, you get:
$ rustfilt '_ZN112_$LT$solana_program..instruction..InstructionError$u20$as$u20$solana_frozen_abi..abi_example..AbiEnumVisitor$GT$13visit_for_abi17h14ef924a4ab59970E'
<solana_program::instruction::InstructionError as solana_frozen_abi::abi_example::AbiEnumVisitor>::visit_for_abi
So this is coming from the implementation of AbiEnumVisitor
for InstructionError
. If you dig into AbiEnumVisitor
at https://github.com/anza-xyz/agave/tree/master/frozen-abi, you'll see that this only used at compile time, to make sure that the enum isn't changed (roughly). It is never actually called at runtime.
In the source code, you'll notice that this derive isn't done anymore for solana
targets: https://github.com/anza-xyz/agave/blob/2e911559d047bcd16ce22f4d3cc4a8604b35bd66/sdk/program/src/instruction.rs#L31 -- so if you use a newer version of the crate, you won't get the error. Be sure to upgrade if you don't want to see the error, but it will never be called in your code.