mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-27 18:56:24 +00:00
![]() Simplify `for` loop desugar Basically two intermediate bindings are inlined. I could have left one intermediate binding in place as this would simplify some diagnostic logic, but I think the difference in that regard would be negligible, so it is better to have a minimal HIR. For checking that the pattern is irrefutable, I added a special case when the `match` is found to be non-exhaustive. The reordering of the arms is purely stylistic. I don't *think* there are any perf implications. ```diff match IntoIterator::into_iter($head) { mut iter => { $label: loop { - let mut __next; match Iterator::next(&mut iter) { - Some(val) => __next = val, None => break, + Some($pat) => $block, } - let $pat = __next; - $block } } } ``` |
||
---|---|---|
.. | ||
bootstrap | ||
build_helper | ||
ci | ||
doc | ||
etc | ||
librustdoc | ||
llvm-project@f9b03d0e2d | ||
rustdoc-json-types | ||
test | ||
tools | ||
README.md | ||
stage0.json | ||
version |
This directory contains the source code of the rust project, including:
- The test suite
- The bootstrapping build system
- Various submodules for tools, like rustdoc, rls, etc.
For more information on how various parts of the compiler work, see the rustc dev guide.