Closed
Description
Here's a program:
fn main() {
let x = ~1;
}
Its output:
error: expected expression, found `~`
--> <anon>:2:13
|
2 | let x = ~1;
| ^
error: aborting due to previous error
Given that this is our only deviation from C-style bitwise operator syntax, it would be nice to have a note of some kind to suggest !
here.
Ideally the note would only appear when the ~
looks like it's being applied as a unary operator on a numeric type, but if that would require too much machinery then something simpler will suffice.