aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-08 09:44:26 +0100
committerGitHub <[email protected]>2019-10-08 09:44:26 +0100
commitd9338dfa98964c0dac8fc082c3d9201807feced0 (patch)
tree2e1f841be60665df9e5c61845fb49e93a6332c68 /crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rs
parent523d7d2c8210b382146c76927e93f1cc8a6d31e2 (diff)
parentb4fe06bc17127b6007114a8ba8bf876fdef112e0 (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.rs3
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 @@
1fn foo() {
2 let _ = &1 as *const i32;
3}