summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-03-26 12:39:20 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2012-03-26 12:45:47 +0200
commit87e097a85346c947cea60b000677bae10409b804 (patch)
treec3e6554920d38c4f3554cd0354d8d11ebef2b2b3 /src/libstd
parente4c141a331f72f55daabd0e77a74584683350f2b (diff)
downloadrust-87e097a85346c947cea60b000677bae10409b804.tar.gz
rust-87e097a85346c947cea60b000677bae10409b804.zip
Disallow ret inside of block functions
Also adds proper checking for cont/break being inside a loop.

Closes #1854
Issue #1619
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/rope.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs
index e4438b77a00..2452188db24 100644
--- a/src/libstd/rope.rs
+++ b/src/libstd/rope.rs
@@ -399,7 +399,7 @@ Loop through a rope, char by char, until the end.
 fn iter_chars(rope: rope, it: fn(char)) {
     loop_chars(rope) {|x|
         it(x);
-        ret true
+        true
     };
 }
 
@@ -1043,9 +1043,9 @@ mod node {
 
     fn loop_chars(node: @node, it: fn(char) -> bool) -> bool {
         ret loop_leaves(node, {|leaf|
-            ret str::all_between(*leaf.content,
-                                 leaf.byte_offset,
-                                 leaf.byte_len, it)
+            str::all_between(*leaf.content,
+                             leaf.byte_offset,
+                             leaf.byte_len, it)
         })
     }