1 // compile-flags: --crate-type=lib
3 // A bunch of tests for syntactic forms involving blocks that were
4 // previously ambiguous (e.g., 'if true { } *val;' gets parsed as a
10 fn test1() { let val = &0; { } *val; }
12 fn test2() -> isize { let val = &0; { } *val }
14 #[derive(Copy, Clone)]
15 struct S { eax: isize }
18 let regs = &Cell::new(S {eax: 0});
19 match true { true => { } _ => { } }
23 fn test4() -> bool { let regs = &true; if true { } *regs || false }
25 fn test5() -> (isize, isize) { { } (0, 1) }
27 fn test6() -> bool { { } (true || false) && true }
31 match true { true => { } _ => { } }
49 let regs = &Cell::new(0);
50 match true { true => { } _ => { } } regs.set(regs.get() + 1);
53 fn test10() -> isize {
55 match true { true => { } _ => { } }
59 fn test11() -> Vec<isize> { if true { } vec![1, 2] }