commit | 4daa43aaff53c3d54ca1bd13fd7d40872048bcb1 | [log] [tgz] |
---|---|---|
author | León Orell Valerian Liehr <me@fmease.dev> | Wed Feb 21 16:32:57 2024 +0100 |
committer | GitHub <noreply@github.com> | Wed Feb 21 16:32:57 2024 +0100 |
tree | e44db37e947a8c4b8a40ef26357179a44b3041b9 | |
parent | 082b97ad05f759c81b3961dceb9969f16181a593 [diff] | |
parent | c1514a6324cf80c52f7eb39b7a74df89b3769106 [diff] |
Rollup merge of #121175 - Nadrieril:simplify-or-selection, r=matthewjasper match lowering: test one or pattern at a time This is a bit more opinionated than the previous PRs. On the face of it this is less efficient and more complex than before, but I personally found the loop that digs into `leaf_candidates` on each iteration very confusing. Instead this does "generate code for this or-pattern" then "generate further code for each branch if needed" in two steps. Incidentally this way we don't _require_ or patterns to be sorted at the end. It's still an important optimization but I find it clearer to not rely on it for correctness. r? `@matthewjasper`
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Note: this README is for users rather than contributors. If you wish to contribute to the compiler, you should read CONTRIBUTING.md instead.
Read “Installation” from The Book.
If you really want to install from source (though this is not recommended), see INSTALL.md.
See https://www.rust-lang.org/community for a list of chat platforms and forums.
See CONTRIBUTING.md.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the “Rust Trademarks”).
If you want to use these names or brands, please read the media guide.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.