1 // run-pass 2 3 #![allow(unconditional_recursion)] 4 #![allow(non_camel_case_types)] 5 #![allow(dead_code)] 6 #![allow(unused_mut)] 7 8 9 10 type t = isize; 11 nothing()12fn nothing() { } 13 putstr(_s: String)14fn putstr(_s: String) { } 15 putint(_i: isize)16fn putint(_i: isize) { 17 let mut i: isize = 33; 18 while i < 36 { putstr("hi".to_string()); i = i + 1; } 19 } 20 zerg(i: isize) -> isize21fn zerg(i: isize) -> isize { return i; } 22 foo(x: isize) -> isize23fn foo(x: isize) -> isize { 24 let mut y: t = x + 2; 25 putstr("hello".to_string()); 26 while y < 10 { putint(y); if y * 3 == 4 { y = y + 2; nothing(); } } 27 let mut z: t; 28 z = 0x55; 29 foo(z); 30 return 0; 31 } 32 main()33pub fn main() { 34 let x: isize = 2 + 2; 35 println!("{}", x); 36 println!("hello, world"); 37 println!("{}", 10); 38 } 39