Optimize when there are multiple variants of the same type
https://github.com/taiki-e/auto_enums/issues/14#issuecomment-483672675
Another problem is that the current
?operator support generates the same number of variants as the?operators are used. This may generate code that is less efficient than boxing based error handling for functions that use many?operators. Since proc_macro doesn't understand types (i.e., it is difficult to optimize that), proc-macro crate, which provides only this feature, it will not be very useful.
I don't know if there is any way to fix this issue at this time.
cc https://github.com/rust-lang/rfcs/issues/2414
This is actually a discussion "is there a way to optimize when there are multiple variants of the same type?"