]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/assoc-oddities-1.rs
Account for ADT bodies and struct expressions
[rust.git] / src / test / ui / parser / assoc-oddities-1.rs
1 // compile-flags: -Z parse-only
2
3 fn main() {
4     // following lines below parse and must not fail
5     x = if c { a } else { b }();
6     x = if true { 1 } else { 0 } as *mut _;
7     // however this does not parse and probably should fail to retain compat?
8     // N.B., `..` here is arbitrary, failure happens/should happen ∀ops that aren’t `=`
9     // see assoc-oddities-2 and assoc-oddities-3
10     ..if c { a } else { b }[n]; //~ ERROR expected one of
11 }