diff options
| author | blake2-ppc <blake2-ppc> | 2013-07-31 21:07:45 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-08-01 16:54:22 +0200 |
| commit | 7e210a8129c844e0b3aca4a28153effd0817ef41 (patch) | |
| tree | a48837c9ed59251169c728c541d78632ea44b2f0 /src/libstd/stackwalk.rs | |
| parent | e5a64f2adddd1ed2ec8e92ec94658b24ece4dbfc (diff) | |
| download | rust-7e210a8129c844e0b3aca4a28153effd0817ef41.tar.gz rust-7e210a8129c844e0b3aca4a28153effd0817ef41.zip | |
std: Replace `for` with `do { .. }` expr in std::gc
Change all users of old-style for with internal iterators to using
`do`-loops.
The code in stackwalk.rs does not actually implement the
looping protocol (no break on return false).
The code in gc.rs does not use loop breaks, nor does any code using it.
We remove the capacity to break from the loops in std::gc and implement
the walks using `do { .. }` expressions.
No behavior change.
Diffstat (limited to 'src/libstd/stackwalk.rs')
| -rw-r--r-- | src/libstd/stackwalk.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/stackwalk.rs b/src/libstd/stackwalk.rs index c3e3ca57a8e..cc516fb559e 100644 --- a/src/libstd/stackwalk.rs +++ b/src/libstd/stackwalk.rs @@ -25,7 +25,7 @@ pub fn Frame(fp: *Word) -> Frame { } } -pub fn walk_stack(visit: &fn(Frame) -> bool) -> bool { +pub fn walk_stack(visit: &fn(Frame)) { debug!("beginning stack walk"); @@ -51,12 +51,11 @@ pub fn walk_stack(visit: &fn(Frame) -> bool) -> bool { } } } - return true; } #[test] fn test_simple() { - for walk_stack |_frame| { + do walk_stack |_frame| { } } @@ -65,7 +64,7 @@ fn test_simple_deep() { fn run(i: int) { if i == 0 { return } - for walk_stack |_frame| { + do walk_stack |_frame| { // Would be nice to test something here... } run(i - 1); |
