]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/linear-for-loop.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / linear-for-loop.rs
index 4dcc5801faf9d8aff59cf18f688d5dcae37104a1..f527ad77a9273d3112e43e76557b3950752a8a63 100644 (file)
@@ -8,15 +8,17 @@
 // 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);
+    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";
+    let s = "hello there".to_string();
     let mut i: int = 0;
-    for c in s.bytes() {
+    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)); }
@@ -25,8 +27,8 @@ pub fn main() {
         // ...
 
         i += 1;
-        println!("{:?}", i);
-        println!("{:?}", c);
+        println!("{}", i);
+        println!("{}", c);
     }
     assert_eq!(i, 11);
 }