2 #![allow(unused_braces)]
5 // Tests for standalone blocks as expressions
7 fn test_basic() { let rs: bool = { true }; assert!((rs)); }
9 struct RS { v1: isize, v2: isize }
11 fn test_rec() { let rs = { RS {v1: 10, v2: 20} }; assert_eq!(rs.v2, 20); }
13 fn test_filled_with_stuff() {
14 let rs = { let mut a = 0; while a < 10 { a += 1; } a };
18 pub fn main() { test_basic(); test_rec(); test_filled_with_stuff(); }