Why can't the compiler parse "a as u32 < b" or similar?

Viewed 619

The following code appears to be trivial and unambiguous (Playground):

let a: u16 = 5;
let b: u32 = 10;

let c = a as u32 < b;

Yet the compiler (as of 2017-05-30) fails with a syntax error:

error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `;`
 --> src/main.rs:6:25
  |
6 |     let c = a as u32 < b;
  |        

What is wrong with the compiler?

1 Answers
Related