diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-08 09:44:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-08 09:44:26 +0100 |
commit | d9338dfa98964c0dac8fc082c3d9201807feced0 (patch) | |
tree | 2e1f841be60665df9e5c61845fb49e93a6332c68 /crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs | |
parent | 523d7d2c8210b382146c76927e93f1cc8a6d31e2 (diff) | |
parent | b4fe06bc17127b6007114a8ba8bf876fdef112e0 (diff) |
Merge #1951
1951: Lower the precedence of the `as` operator. r=matklad a=goffrie
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.
Fixes #1851.
Co-authored-by: Geoffry Song <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs new file mode 100644 index 000000000..a06dec1fa --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | let _ = &1 as *const i32; | ||
3 | } | ||