Github Store VariantIdx to distinguish enum variants by Mark-Simulacrum · Pull R...
source link: https://github.com/rust-lang/rust/pull/85195
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
This saves ~24% of the instructions on the match-stress-enum benchmark, but I'm not 100% sure that this is OK - if we ever compare two constructors across enums (e.g., a Result and an Option), then this is obviously insufficient; I can experiment with continuing to store the DefId for comparison purposes in that case.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK