Commit 0144baf
rust: avoid ICE on attributed struct base parsing
gcc/rust/ChangeLog:
* parse/rust-parse-error.h (StructExprField): Add
STRUCT_BASE_ATTRIBUTES.
* parse/rust-parse-impl-expr.hxx
(Parser<ManagedTokenSource>::parse_struct_expr_field):
Reject attributes before struct-base `..`.
(Parser<ManagedTokenSource>::parse_struct_expr_struct_partial):
Handle struct-base parse results without dereferencing an errored
expected.
gcc/testsuite/ChangeLog:
* rust/compile/issue-4476.rs: New test.
Signed-off-by: Hritam Shrivastava <hritamstark05@gmail.com>1 parent 2c7b222 commit 0144baf
3 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
361 | 362 | | |
362 | 363 | | |
363 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1752 | 1752 | | |
1753 | 1753 | | |
1754 | 1754 | | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1755 | 1765 | | |
1756 | 1766 | | |
1757 | 1767 | | |
| |||
4068 | 4078 | | |
4069 | 4079 | | |
4070 | 4080 | | |
4071 | | - | |
4072 | | - | |
| 4081 | + | |
4073 | 4082 | | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
4074 | 4090 | | |
4075 | 4091 | | |
4076 | 4092 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments