Commit a67aafd
committed
Fix Self macro invocation parsing failure
No check was performed and the value was assumed non null.
Path conversion returned an empty path for "Self" due to a hack in
generics Self injection that prevented any "Self!" macro from beeing
recognized correctly.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_stmt_or_expr): Add null check
on parse_macro_invocation_partial call.
* ast/rust-path.cc (Path::convert_to_simple_path): Do not exclude
capitalized "Self".
gcc/testsuite/ChangeLog:
* rust/compile/issue-3974.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>1 parent 6709c31 commit a67aafd
File tree
3 files changed
+17
-5
lines changed- gcc
- rust
- ast
- parse
- testsuite/rust/compile
3 files changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
| 170 | + | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11761 | 11761 | | |
11762 | 11762 | | |
11763 | 11763 | | |
| 11764 | + | |
| 11765 | + | |
11764 | 11766 | | |
11765 | 11767 | | |
11766 | 11768 | | |
| |||
11772 | 11774 | | |
11773 | 11775 | | |
11774 | 11776 | | |
11775 | | - | |
11776 | | - | |
11777 | | - | |
| 11777 | + | |
| 11778 | + | |
| 11779 | + | |
| 11780 | + | |
| 11781 | + | |
| 11782 | + | |
11778 | 11783 | | |
11779 | 11784 | | |
11780 | 11785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments