]> git.lizzy.rs Git - rust.git/commit
rustc: Allow `return` to return from a closure.
authorHuon Wilson <dbau.pp+github@gmail.com>
Tue, 17 Dec 2013 13:06:20 +0000 (00:06 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Wed, 18 Dec 2013 11:53:45 +0000 (22:53 +1100)
commit6876916a45f14973897dd05fe4dfdd2b47ac9607
tree9c6b013ca2585548faf82501f3e89016bc713a69
parent47c9a35747e9a15830e35924429050b820825f5d
rustc: Allow `return` to return from a closure.

With the old `for` gone, this behaviour is no longer conflicting with
that use of `return` in closures, and this allows shortcircuiting in a
closure.
src/librustc/middle/check_loop.rs
src/test/compile-fail/return-in-block-function.rs [deleted file]
src/test/run-pass/return-from-closure.rs [new file with mode: 0644]