about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-07-31 03:58:21 -0700
committerbors <bors@rust-lang.org>2013-07-31 03:58:21 -0700
commit6296dc0d73527301f18ef55b5f2d07c3241b8a00 (patch)
tree9ca1c483e62e852fb33db8aee766ba4c7e798eb9 /src/rt/rust_builtin.cpp
parent8b7e241e02bb9f82d7b931033afde477d03ff4f2 (diff)
parenta696f0fecb9d11204f64d310eb66e095f64bd04a (diff)
downloadrust-6296dc0d73527301f18ef55b5f2d07c3241b8a00.tar.gz
rust-6296dc0d73527301f18ef55b5f2d07c3241b8a00.zip
auto merge of #8141 : graydon/rust/foreach-in-sketch, r=brson
This is a preliminary implementation of `for ... in ... { ...}` using a transitionary keyword `foreach`. Codesize seems to be a little bit down (10% or less non-opt) and otherwise it seems quite trivial to rewrite lambda-based loops to use it. Once we've rewritten the codebase away from lambda-based `for` we can retarget that word at the same production, snapshot, rewrite the keywords in one go, and expire `foreach`.

Feedback welcome. It's a desugaring-based approach which is arguably something we should have been doing for other constructs before. I apologize both for the laziness associated with doing it this way and with any sense that I'm bending rules I put in place previously concerning "never doing desugarings". I put the expansion in `expand.rs` and would be amenable to the argument that the code there needs better factoring / more helpers / to move to a submodule or helper function. It does seem to work at this point, though, and I gather we'd like to get the shift done relatively quickly.

Diffstat (limited to 'src/rt/rust_builtin.cpp')
0 files changed, 0 insertions, 0 deletions