diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-07 08:15:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-07 08:15:21 +0100 |
| commit | 111724f5e2baa8b54612295352ba7b17a29b6059 (patch) | |
| tree | a3ea342d66d0bf819c9220c0d01669c77418ca06 /src/rustllvm/RustWrapper.cpp | |
| parent | e8bb6c05ab455999ccfe10e178bc2ada9d450187 (diff) | |
| parent | 453c5051476fab4d09f6d16bdbf37043c5c26a27 (diff) | |
| download | rust-111724f5e2baa8b54612295352ba7b17a29b6059.tar.gz rust-111724f5e2baa8b54612295352ba7b17a29b6059.zip | |
Rollup merge of #68985 - daboross:fix-35813, r=Centril
Parse & reject postfix operators after casts This adds an explicit error messages for when parsing `x as Type[0]` or similar expressions. Our add an extra parse case for parsing any postfix operator (dot, indexing, method calls, await) that triggers directly after parsing `as` expressions. My friend and I worked on this together, but they're still deciding on a github username and thus I'm submitting this for both of us. It will immediately error out, but will also provide the rest of the parser with a useful parse tree to deal with. There's one decision we made in how this produces the parse tree. In the situation `&x as T[0]`, one could imagine this parsing as either `&((x as T)[0])` or `((&x) as T)[0]`. We chose the latter for ease of implementation, and as it seemed the most intuitive. Feedback welcome! This is our first change to the parser section, and it might be completely horrible. Fixes #35813.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
