1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
fn main() { let x = 1; let y = 2; println!("x + y = {}", x + y); } fn foo() { #![attribute] let x = 1; // comment } // comment after item // comment before item fn bar() { let x = 1; // comment after statement // comment before statement let y = 2; let z = 3; println!("x + y + z = {}", x + y + z); }