Skip to content

Commit deee5c9

Browse files
committed
---
yaml --- r: 30226 b: refs/heads/incoming c: 34bf846 h: refs/heads/master v: v3
1 parent 411f00d commit deee5c9

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: e2667fda8705dc2f626d9910dfd663243111aef7
9+
refs/heads/incoming: 34bf84649e811e93cad521bba5116117b86bd57b
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libstd/rope.rs

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* * access to a character by index is logarithmic (linear in strings);
2424
*/
2525

26+
#[forbid(deprecated_mode)];
27+
#[forbid(deprecated_pattern)];
2628

2729
/// The type of ropes.
2830
type rope = node::root;
@@ -436,7 +438,7 @@ mod iterator {
436438
node::content(x) => return node::leaf_iterator::start(x)
437439
}
438440
}
439-
fn next(it: node::leaf_iterator::t) -> Option<node::leaf> {
441+
fn next(it: &node::leaf_iterator::t) -> Option<node::leaf> {
440442
return node::leaf_iterator::next(it);
441443
}
442444
}
@@ -447,7 +449,7 @@ mod iterator {
447449
node::content(x) => return node::char_iterator::start(x)
448450
}
449451
}
450-
fn next(it: node::char_iterator::t) -> Option<char> {
452+
fn next(it: &node::char_iterator::t) -> Option<char> {
451453
return node::char_iterator::next(it)
452454
}
453455
}
@@ -751,7 +753,7 @@ mod node {
751753
* * forest - The forest. This vector is progressively rewritten during
752754
* execution and should be discarded as meaningless afterwards.
753755
*/
754-
fn tree_from_forest_destructive(forest: ~[mut @node]) -> @node {
756+
fn tree_from_forest_destructive(forest: &[mut @node]) -> @node {
755757
let mut i;
756758
let mut len = vec::len(forest);
757759
while len > 1u {
@@ -800,7 +802,7 @@ mod node {
800802
let mut offset = 0u;//Current position in the buffer
801803
let it = leaf_iterator::start(node);
802804
loop {
803-
match (leaf_iterator::next(it)) {
805+
match (leaf_iterator::next(&it)) {
804806
option::None => break,
805807
option::Some(x) => {
806808
//FIXME (#2744): Replace with memcpy or something similar
@@ -861,7 +863,7 @@ mod node {
861863
let mut forest = ~[mut];
862864
let it = leaf_iterator::start(node);
863865
loop {
864-
match (leaf_iterator::next(it)) {
866+
match (leaf_iterator::next(&it)) {
865867
option::None => break,
866868
option::Some(x) => vec::push(forest, @leaf(x))
867869
}
@@ -1018,7 +1020,7 @@ mod node {
10181020
let itb = char_iterator::start(b);
10191021
let mut result = 0;
10201022
while result == 0 {
1021-
match ((char_iterator::next(ita), char_iterator::next(itb))) {
1023+
match ((char_iterator::next(&ita), char_iterator::next(&itb))) {
10221024
(option::None, option::None) => break,
10231025
(option::Some(chara), option::Some(charb)) => {
10241026
result = char::cmp(chara, charb);
@@ -1121,7 +1123,7 @@ mod node {
11211123
}
11221124
}
11231125

1124-
fn next(it: t) -> Option<leaf> {
1126+
fn next(it: &t) -> Option<leaf> {
11251127
if it.stackpos < 0 { return option::None; }
11261128
loop {
11271129
let current = it.stack[it.stackpos];
@@ -1162,7 +1164,7 @@ mod node {
11621164
}
11631165
}
11641166

1165-
fn next(it: t) -> Option<char> {
1167+
fn next(it: &t) -> Option<char> {
11661168
loop {
11671169
match (get_current_or_next_leaf(it)) {
11681170
option::None => return option::None,
@@ -1177,36 +1179,36 @@ mod node {
11771179
};
11781180
}
11791181

1180-
fn get_current_or_next_leaf(it: t) -> Option<leaf> {
1181-
match (it.leaf) {
1182-
option::Some(_) => return it.leaf,
1182+
fn get_current_or_next_leaf(it: &t) -> Option<leaf> {
1183+
match ((*it).leaf) {
1184+
option::Some(_) => return (*it).leaf,
11831185
option::None => {
1184-
let next = leaf_iterator::next(it.leaf_iterator);
1186+
let next = leaf_iterator::next(&((*it).leaf_iterator));
11851187
match (next) {
11861188
option::None => return option::None,
11871189
option::Some(_) => {
1188-
it.leaf = next;
1189-
it.leaf_byte_pos = 0u;
1190+
(*it).leaf = next;
1191+
(*it).leaf_byte_pos = 0u;
11901192
return next;
11911193
}
11921194
}
11931195
}
11941196
}
11951197
}
11961198

1197-
fn get_next_char_in_leaf(it: t) -> Option<char> {
1198-
match copy it.leaf {
1199+
fn get_next_char_in_leaf(it: &t) -> Option<char> {
1200+
match copy (*it).leaf {
11991201
option::None => return option::None,
12001202
option::Some(aleaf) => {
1201-
if it.leaf_byte_pos >= aleaf.byte_len {
1203+
if (*it).leaf_byte_pos >= aleaf.byte_len {
12021204
//We are actually past the end of the leaf
1203-
it.leaf = option::None;
1205+
(*it).leaf = option::None;
12041206
return option::None
12051207
} else {
12061208
let {ch, next} =
12071209
str::char_range_at(*aleaf.content,
1208-
it.leaf_byte_pos + aleaf.byte_offset);
1209-
it.leaf_byte_pos = next - aleaf.byte_offset;
1210+
(*it).leaf_byte_pos + aleaf.byte_offset);
1211+
(*it).leaf_byte_pos = next - aleaf.byte_offset;
12101212
return option::Some(ch)
12111213
}
12121214
}
@@ -1274,7 +1276,7 @@ mod tests {
12741276
let rope_iter = iterator::char::start(r);
12751277
let mut equal = true;
12761278
while equal {
1277-
match (node::char_iterator::next(rope_iter)) {
1279+
match (node::char_iterator::next(&rope_iter)) {
12781280
option::None => {
12791281
if string_iter < string_len {
12801282
equal = false;
@@ -1301,7 +1303,7 @@ mod tests {
13011303
let mut len = 0u;
13021304
let it = iterator::char::start(r);
13031305
loop {
1304-
match (node::char_iterator::next(it)) {
1306+
match (node::char_iterator::next(&it)) {
13051307
option::None => break,
13061308
option::Some(_) => len += 1u
13071309
}

branches/incoming/src/libstd/tempfile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Temporary files and directories
22
3+
#[forbid(deprecated_mode)];
4+
#[forbid(deprecated_pattern)];
5+
36
import core::option;
47
import option::{None, Some};
58
import rand;

0 commit comments

Comments
 (0)