aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data/parser/inline
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-29 16:04:35 +0100
committerGitHub <[email protected]>2020-05-29 16:04:35 +0100
commit30658b25d2bb00ec495e0f3396de772141482081 (patch)
tree2846ebee3a16875674aed26b534f905a30cb598f /crates/ra_syntax/test_data/parser/inline
parent190a0595a478d059fdd95a179fe38d59cb6379be (diff)
parent367487fe88dca78cffad5138673d5259f7f7ba6b (diff)
Merge #4648
4648: Support raw_ref_op's raw reference operator r=matklad a=robojumper Fixes #4642. This syntax (and its semantics) are implemented in rustc behind the `raw_ref_op` feature. It is not entirely clear whether this is the syntax that will become stable, but [it seems like](https://github.com/rust-lang/rust/pull/72279) rust-analyzer must still support this unstable syntax to support future stable rust. Also fixes a random inference failure involving a direct coercion from `&[T, _]` to `*const [T]`. Co-authored-by: robojumper <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline')
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast172
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs6
2 files changed, 134 insertions, 44 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast
index 7fe96e17d..58bdf7e34 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast
@@ -1,5 +1,5 @@
1SOURCE_FILE@0..52 1[email protected]00
2 FN_DEF@0..51 2 [email protected]99
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
@@ -8,47 +8,131 @@ [email protected]
8 [email protected] "(" 8 [email protected] "("
9 [email protected] ")" 9 [email protected] ")"
10 [email protected] " " 10 [email protected] " "
11 BLOCK_EXPR@9..51 11 [email protected]99
12 [email protected] "{" 12 [email protected] "{"
13 [email protected] "\n " 13 [email protected] "\n "
14 [email protected] 14 [email protected] "// reference operator"
15 [email protected] "let" 15 [email protected] "\n "
16 [email protected] " " 16 [email protected]
17 [email protected] 17 [email protected] "let"
18 [email protected] "_" 18 [email protected] " "
19 [email protected] " " 19 [email protected]
20 [email protected] "=" 20 [email protected] "_"
21 [email protected] " " 21 [email protected] " "
22 [email protected] 22 [email protected] "="
23 [email protected] "&" 23 [email protected] " "
24 [email protected] 24 [email protected]
25 [email protected] "1" 25 [email protected] "&"
26 [email protected] ";" 26 [email protected]
27 [email protected] "\n " 27 [email protected] "1"
28 [email protected] 28 [email protected] ";"
29 [email protected] "let" 29 [email protected] "\n "
30 [email protected] " " 30 [email protected]
31 [email protected] 31 [email protected] "let"
32 [email protected] "_" 32 [email protected] " "
33 [email protected] " " 33 [email protected]
34 [email protected] "=" 34 [email protected] "_"
35 [email protected] " " 35 [email protected] " "
36 [email protected] 36 [email protected] "="
37 [email protected] "&" 37 [email protected] " "
38 [email protected] "mut" 38 [email protected]
39 [email protected] " " 39 [email protected] "&"
40 [email protected] 40 [email protected] "mut"
41 [email protected] "&" 41 [email protected] " "
42 [email protected] 42 [email protected]
43 [email protected] 43 [email protected] "&"
44 [email protected] 44 [email protected]
45 [email protected] 45 [email protected]
46 [email protected] 46 [email protected]
47 [email protected] "f" 47 [email protected]
48 [email protected] 48 [email protected]
49 [email protected] "(" 49 [email protected] "f"
50 [email protected] ")" 50 [email protected]
51 [email protected] ";" 51 [email protected] "("
52 [email protected] "\n" 52 [email protected] ")"
53 [email protected] "}" 53 [email protected] ";"
54 [email protected] "\n" 54 [email protected] "\n "
55 [email protected]
56 [email protected] "let"
57 [email protected] " "
58 [email protected]
59 [email protected] "_"
60 [email protected] " "
61 [email protected] "="
62 [email protected] " "
63 [email protected]
64 [email protected] "&"
65 [email protected]
66 [email protected]
67 [email protected]
68 [email protected]
69 [email protected] "raw"
70 [email protected] ";"
71 [email protected] "\n "
72 [email protected]
73 [email protected] "let"
74 [email protected] " "
75 [email protected]
76 [email protected] "_"
77 [email protected] " "
78 [email protected] "="
79 [email protected] " "
80 [email protected]
81 [email protected] "&"
82 [email protected]
83 [email protected]
84 [email protected]
85 [email protected]
86 [email protected]
87 [email protected] "raw"
88 [email protected] "."
89 [email protected]
90 [email protected] "0"
91 [email protected] ";"
92 [email protected] "\n "
93 [email protected] "// raw reference oper ..."
94 [email protected] "\n "
95 [email protected]
96 [email protected] "let"
97 [email protected] " "
98 [email protected]
99 [email protected] "_"
100 [email protected] " "
101 [email protected] "="
102 [email protected] " "
103 [email protected]
104 [email protected] "&"
105 [email protected] "raw"
106 [email protected] " "
107 [email protected] "mut"
108 [email protected] " "
109 [email protected]
110 [email protected]
111 [email protected]
112 [email protected]
113 [email protected] "foo"
114 [email protected] ";"
115 [email protected] "\n "
116 [email protected]
117 [email protected] "let"
118 [email protected] " "
119 [email protected]
120 [email protected] "_"
121 [email protected] " "
122 [email protected] "="
123 [email protected] " "
124 [email protected]
125 [email protected] "&"
126 [email protected] "raw"
127 [email protected] " "
128 [email protected] "const"
129 [email protected] " "
130 [email protected]
131 [email protected]
132 [email protected]
133 [email protected]
134 [email protected] "foo"
135 [email protected] ";"
136 [email protected] "\n"
137 [email protected] "}"
138 [email protected] "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs
index 2dac6be95..c5262f446 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs
@@ -1,4 +1,10 @@
1fn foo() { 1fn foo() {
2 // reference operator
2 let _ = &1; 3 let _ = &1;
3 let _ = &mut &f(); 4 let _ = &mut &f();
5 let _ = &raw;
6 let _ = &raw.0;
7 // raw reference operator
8 let _ = &raw mut foo;
9 let _ = &raw const foo;
4} 10}