Github stabilize `int_error_matching` by eopb · Pull Request #84910 · rust-lang/...
source link: https://github.com/rust-lang/rust/pull/84910
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.
closes #22639
It has been over half a year since #77640 (review), and the indexing question is rejected in #79728 (review), so I guess we can submit another stabilization attempt?
Originally posted by @kennytm in #22639 (comment)
(rust-highfive has picked a reviewer for you, use r? to override)
This comment has been hidden.
Posted one comment about not stabilizing __description
. Other than that, this looks good to me.
r? @joshtriplett for the T-libs FCP and since you've already started a review here
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
The latest upstream changes (presumably #85014) made this pull request unmergeable. Please resolve the merge conflicts.
This comment has been hidden.
This comment has been hidden.
The latest upstream changes (presumably #85058) made this pull request unmergeable. Please resolve the merge conflicts.
You're going to hate me, but I got a snag. https://godbolt.org/z/fPx6ThTYx
It seems that the performance difference between one and two enum arms is very different for u128s. One arm takes 1.7ns but two arms takes 4.7ns.
I would love to understand what's going on because the error is clearly smaller than a u128 even with a fair few enum varients. I don't know why llvm would generate different assembly. I take it mov is much slower than an xor but why llvm why?
(I know worrying about 3ms when the largest i128 currently takes 300ns to parse seems pedantic but I'm working on getting parsing 128s to below 20ns worstcase so it's becoming not insignificant.)
Hmm, seems like our side looking at the generated llvm instructions, but I'm not great at reading the runes.
Copy link
rfcbot commented 20 days ago
This is now entering its final comment period, as per the review above.
Think the bot might have jumped the gun here.
I see 5 out of 7 boxes, which allows FCP to commence. The bot is working fine.
I have concerns that the code gen could perhaps be faster, but that's a seperate concern to stabilisation. Stabilise away.
I have concerns that the code gen could perhaps be faster, but that's a seperate concern to stabilisation. Stabilise away.
i'm not really sure I understand the code gen concern. Is the issue that match statements against enums with multiple variants are slower or that using an error with multiple variant's changes the layout of a Result<u128, TheError>
type? Either way, I don't really see a way to resolve this, we already use these patterns all throughout the rest of std
.
Also, I did a quick test and it seems like it might be possible to avoid the issue by wrapping the inner method we export in std with another one that drops the error type so that the Result
can be optimized the same way it would in the fast case you showed.
This comment has been hidden.
Wow. Compilers are so cool. That's very impressive. - thanks @yaahc
Copy link
rfcbot commented 10 days ago
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
The RFC will be merged soon.
The latest upstream changes (presumably #84985) made this pull request unmergeable. Please resolve the merge conflicts.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK