De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other vec routines.
This commit is contained in:
parent
62b7f4d800
commit
9cf271fe96
81 changed files with 556 additions and 750 deletions
|
|
@ -1,6 +1,6 @@
|
|||
fn want_slice(v: &[int]) -> int {
|
||||
let mut sum = 0;
|
||||
for vec::each(v) |i| { sum += i; }
|
||||
for vec::each(v) |i| { sum += *i; }
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
fn main() {
|
||||
do vec::iter(fail) |i| {
|
||||
for vec::each(fail) |i| {
|
||||
log (debug, i * 2);
|
||||
//~^ ERROR the type of this value must be known
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
fn main() {
|
||||
let a: ~[int] = ~[];
|
||||
vec::each(a, fn@(_x: int) -> bool { //~ ERROR not all control paths return a value
|
||||
vec::each(a, fn@(_x: &int) -> bool {
|
||||
//~^ ERROR not all control paths return a value
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ fn concat<T: Copy>(v: ~[const ~[const T]]) -> ~[T] {
|
|||
let mut r = ~[];
|
||||
|
||||
// Earlier versions of our type checker accepted this:
|
||||
vec::iter(v, |&&inner: ~[T]| {
|
||||
vec::each(v, |inner: &~[T]| {
|
||||
//~^ ERROR values differ in mutability
|
||||
r += inner;
|
||||
r += *inner; true
|
||||
});
|
||||
|
||||
return r;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue