use std; #![warn(unstable)] /* Factorial */ fn fac(n: int) -> int { let s: str = "This is a multi-line string. It ends with an unescaped '\"'."; let c: char = 'ะค'; let r: str = r##" raw string "##; let result = 1, i = 1; while i <= n { // No parens around the condition result *= i; i += 1; } ret result; } pure fn pure_length(ls: list) -> uint { /* ... */ } type t = map::hashtbl; let x = id::(10); // Define some modules. #[path = "foo.rs"] mod foo; impl Seq for [T] { fn len() -> uint { vec::len(self) } fn iter(b: fn(T)) { for elt in self { b(elt); } } } enum list { Nil; Cons(T, @list); } let a: list = Cons(7, @cons(13, @nil)); struct Baz<'a> { baz: &'a str, } 'h: for i in range(0,10) { 'g: loop { if i % 2 == 0 { continue 'h; } if i == 9 { break 'h; } break 'g; } }