4

Rewrite exhaustiveness in one pass by Nadrieril · Pull Request #117611 · rust-la...

 4 months ago
source link: https://github.com/rust-lang/rust/pull/117611
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.

Conversation

Contributor

This is at least my 4th attempt at this in as many years x) Previous attempts were all too complicated or too slow. But we're finally here!

The previous version of the exhaustiveness algorithm computed reachability for each arm then exhaustiveness of the whole match. Since each of these steps does roughly the same things, this rewrites the algorithm to do them all in one go. I also think this makes things much simpler.

I also rewrote the documentation of the algorithm in depth. Hopefully it's up-to-date and easier to follow now. Plz comment if anything's unclear.

r? @oli-obk I think you're one of the rare other people to understand the exhaustiveness algorithm?

cc @varkor I know you're not active anymore, but if you feel like having a look you might enjoy this :D

Fixes #79307

varkor, Xanewok, safinaskar, Nilstrieb, Amejonah1200, mati865, gimbling-away, benluelo, jeffparsons, Kobzol, and 2 more reacted with heart emoji

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK