diff options
author | Geoffry Song <[email protected]> | 2019-10-03 08:10:58 +0100 |
---|---|---|
committer | Geoffry Song <[email protected]> | 2019-10-03 08:27:09 +0100 |
commit | b63f260bbcf89a2b40358f534b97f672468294fb (patch) | |
tree | 9a21ac5bc76e828025c9dd66b01ea1e27bd38d50 /crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs | |
parent | e1c367595139f109fb6f53811bed7d67a384793e (diff) |
Lower the precedence of the `as` operator.
Previously, the `as` operator was being parsed like a postfix expression, and
therefore being given the highest possible precedence. That caused it to bind
more tightly than prefix operators, which it should not. Instead, parse it
somewhat like a normal binary expression with some special-casing.
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs index f1c3f7118..1080b48a1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs | |||
@@ -1,5 +1,9 @@ | |||
1 | fn foo() { | 1 | fn foo() { |
2 | **&1; | 2 | **&1 + 1; |
3 | !!true; | 3 | !!true; |
4 | --1; | 4 | --1; |
5 | *&1 as u64; | ||
6 | *x(1); | ||
7 | &x[1]; | ||
8 | -1..2; | ||
5 | } | 9 | } |