fn main() { auto x = vec(1,2,3); auto y = 0; for (int i in x) { log i; y += i; } log y; check (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { check (c == u8('h')); } if (i == 1) { check (c == u8('e')); } if (i == 2) { check (c == u8('l')); } if (i == 3) { check (c == u8('l')); } if (i == 4) { check (c == u8('o')); } // ... if (i == 12) { check (c == u8(0)); } i += 1; log i; log c; } check(i == 12); } fn main() { auto x = vec(1,2,3); auto y = 0; for (int i in x) { log i; y += i; } log y; check (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { check (c == ('h' as u8)); } if (i == 1) { check (c == ('e' as u8)); } if (i == 2) { check (c == ('l' as u8)); } if (i == 3) { check (c == ('l' as u8)); } if (i == 4) { check (c == ('o' as u8)); } // ... if (i == 12) { check (c == (0 as u8)); } i += 1; log i; log c; } check(i == 12); } fn main() { auto x = vec(1,2,3); auto y = 0; for (int i in x) { log i; y += i; } log y; check (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { check (c == ('h' as u8)); } if (i == 1) { check (c == ('e' as u8)); } if (i == 2) { check (c == ('l' as u8)); } if (i == 3) { check (c == ('l' as u8)); } if (i == 4) { check (c == ('o' as u8)); } // ... i += 1; log i; log c; } check(i == 11); } fn main() { auto x = vec(1,2,3); auto y = 0; for (int i in x) { log i; y += i; } log y; assert (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { assert (c == ('h' as u8)); } if (i == 1) { assert (c == ('e' as u8)); } if (i == 2) { assert (c == ('l' as u8)); } if (i == 3) { assert (c == ('l' as u8)); } if (i == 4) { assert (c == ('o' as u8)); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { auto x = vec(1,2,3); auto y = 0; for (int i in x) { log i; y += i; } log y; check (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { check (c == ('h' as u8)); } if (i == 1) { check (c == ('e' as u8)); } if (i == 2) { check (c == ('l' as u8)); } if (i == 3) { check (c == ('l' as u8)); } if (i == 4) { check (c == ('o' as u8)); } // ... i += 1; log i; log c; } check(i == 11); } fn main() { auto x = vec(1,2,3); auto y = 0; for (int i in x) { log i; y += i; } log y; assert (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { assert (c == ('h' as u8)); } if (i == 1) { assert (c == ('e' as u8)); } if (i == 2) { assert (c == ('l' as u8)); } if (i == 3) { assert (c == ('l' as u8)); } if (i == 4) { assert (c == ('o' as u8)); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { auto x = [1,2,3]; auto y = 0; for (int i in x) { log i; y += i; } log y; assert (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { assert (c == ('h' as u8)); } if (i == 1) { assert (c == ('e' as u8)); } if (i == 2) { assert (c == ('l' as u8)); } if (i == 3) { assert (c == ('l' as u8)); } if (i == 4) { assert (c == ('o' as u8)); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { auto x = [1, 2, 3]; auto y = 0; for (int i in x) { log i; y += i; } log y; assert (y == 6); auto s = "hello there"; let int i = 0; for (u8 c in s) { if (i == 0) { assert (c == 'h' as u8); } if (i == 1) { assert (c == 'e' as u8); } if (i == 2) { assert (c == 'l' as u8); } if (i == 3) { assert (c == 'l' as u8); } if (i == 4) { assert (c == 'o' as u8); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { let x = [1, 2, 3]; let y = 0; for i: int in x { log i; y += i; } log y; assert (y == 6); let s = "hello there"; let i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { let x = ~[1, 2, 3]; let y = 0; for i: int in x { log i; y += i; } log y; assert (y == 6); let s = "hello there"; let i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { let x = ~[1, 2, 3]; let y = 0; for i: int in x { log i; y += i; } log y; assert (y == 6); let s = "hello there"; let i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { let x = [1, 2, 3]; let y = 0; for i: int in x { log i; y += i; } log y; assert (y == 6); let s = "hello there"; let i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log i; log c; } assert (i == 11); } fn main() { let x = [1, 2, 3]; let y = 0; for i: int in x { log_full(core::debug, i); y += i; } log_full(core::debug, y); assert (y == 6); let s = "hello there"; let i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log_full(core::debug, i); log_full(core::debug, c); } assert (i == 11); } fn main() { let x = [1, 2, 3]; let y = 0; for i: int in x { log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = "hello there"; let i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = [1, 2, 3]; let mut y = 0; for i: int in x { log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = "hello there"; let mut i: int = 0; for c: u8 in s { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = [1, 2, 3]; let mut y = 0; for x.each {|i| log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = "hello there"; let mut i: int = 0; for str::each(s) {|c| if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = [1, 2, 3]/~; let mut y = 0; for x.each {|i| log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = "hello there"; let mut i: int = 0; for str::each(s) {|c| if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each {|i| log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = "hello there"; let mut i: int = 0; for str::each(s) {|c| if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = "hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { log(debug, i); y += i; } log(debug, y); assert (y == 6); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { log(debug, *i); y += *i; } log(debug, y); assert (y == 6); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { log(debug, *i); y += *i; } log(debug, y); assert (y == 6); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { log(debug, *i); y += *i; } log(debug, y); assert (y == 6); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert (c == 'h' as u8); } if i == 1 { assert (c == 'e' as u8); } if i == 2 { assert (c == 'l' as u8); } if i == 3 { assert (c == 'l' as u8); } if i == 4 { assert (c == 'o' as u8); } // ... i += 1; log(debug, i); log(debug, c); } assert (i == 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { log(debug, *i); y += *i; } log(debug, y); fail_unless!((y == 6)); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { fail_unless!((c == 'h' as u8)); } if i == 1 { fail_unless!((c == 'e' as u8)); } if i == 2 { fail_unless!((c == 'l' as u8)); } if i == 3 { fail_unless!((c == 'l' as u8)); } if i == 4 { fail_unless!((c == 'o' as u8)); } // ... i += 1; log(debug, i); log(debug, c); } fail_unless!((i == 11)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { debug!(*i); y += *i; } debug!(y); fail_unless!((y == 6)); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { fail_unless!((c == 'h' as u8)); } if i == 1 { fail_unless!((c == 'e' as u8)); } if i == 2 { fail_unless!((c == 'l' as u8)); } if i == 3 { fail_unless!((c == 'l' as u8)); } if i == 4 { fail_unless!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } fail_unless!((i == 11)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { debug!(*i); y += *i; } debug!(y); assert!((y == 6)); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } assert!((i == 11)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { debug!(*i); y += *i; } debug!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::str; pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { debug!(*i); y += *i; } debug!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for str::each(s) |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::iterator::IteratorUtil; pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { debug!(*i); y += *i; } debug!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for s.bytes_iter().advance |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.each |i| { debug!(*i); y += *i; } debug!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for s.bytes_iter().advance |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.iter().advance |i| { debug!(*i); y += *i; } debug!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for s.bytes_iter().advance |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; debug!(i); debug!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.iter().advance |i| { info!(*i); y += *i; } info!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for s.bytes_iter().advance |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info!(i); info!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for x.iter().advance |i| { info!(*i); y += *i; } info!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for s.byte_iter().advance |c| { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info!(i); info!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; foreach i in x.iter() { info!(*i); y += *i; } info!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; foreach c in s.byte_iter() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info!(i); info!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for i in x.iter() { info!(*i); y += *i; } info!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for c in s.byte_iter() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info!(i); info!(c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for i in x.iter() { info2!("{:?}", *i); y += *i; } info2!("{:?}", y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for c in s.byte_iter() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info2!("{:?}", i); info2!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for i in x.iter() { info!("{:?}", *i); y += *i; } info!("{:?}", y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for c in s.byte_iter() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info!("{:?}", i); info!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for i in x.iter() { info!("{:?}", *i); y += *i; } info!("{:?}", y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; info!("{:?}", i); info!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_owned(); let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_owned(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. extern crate debug; pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. extern crate debug; pub fn main() { let x = vec!(1i, 2i, 3i); let mut y = 0i; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-pretty FIXME #15189 extern crate debug; pub fn main() { let x = vec!(1i, 2i, 3i); let mut y = 0i; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // no-pretty-expanded FIXME #15189 extern crate debug; pub fn main() { let x = vec!(1i, 2i, 3i); let mut y = 0i; for i in x.iter() { println!("{:?}", *i); y += *i; } println!("{:?}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{:?}", i); println!("{:?}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // no-pretty-expanded FIXME #15189 pub fn main() { let x = vec!(1i, 2i, 3i); let mut y = 0i; for i in x.iter() { println!("{}", *i); y += *i; } println!("{}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.as_slice().bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{}", i); println!("{}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // no-pretty-expanded FIXME #15189 pub fn main() { let x = vec!(1i, 2i, 3i); let mut y = 0i; for i in x.iter() { println!("{}", *i); y += *i; } println!("{}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{}", i); println!("{}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // no-pretty-expanded FIXME #15189 pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in x.iter() { println!("{}", *i); y += *i; } println!("{}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{}", i); println!("{}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // no-pretty-expanded FIXME #15189 pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in &x { println!("{}", *i); y += *i; } println!("{}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: int = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{}", i); println!("{}", c); } assert_eq!(i, 11); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // no-pretty-expanded FIXME #15189 pub fn main() { let x = vec!(1, 2, 3); let mut y = 0; for i in &x { println!("{}", *i); y += *i; } println!("{}", y); assert_eq!(y, 6); let s = "hello there".to_string(); let mut i: isize = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } if i == 2 { assert!((c == 'l' as u8)); } if i == 3 { assert!((c == 'l' as u8)); } if i == 4 { assert!((c == 'o' as u8)); } // ... i += 1; println!("{}", i); println!("{}", c); } assert_eq!(i, 11); }