Commit 6996255
gccrs: fix parser error on parenthesis types
Do not cast parenthesised types to TraitBound types.
Fixes #4148
gcc/rust/ChangeLog:
* ast/rust-path.cc (TypePath::to_trait_bound): Check if in
parenthesis.
* hir/tree/rust-hir-type.cc (ParenthesisedType::to_trait_bound):
Likewise.
* hir/tree/rust-hir.cc (TypePath::to_trait_bound): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/issue-4148.rs: Test should produce errors.
Signed-off-by: lenny.chiadmi-delage <[email protected]>1 parent d432809 commit 6996255
File tree
4 files changed
+16
-3
lines changed- gcc
- rust
- ast
- hir/tree
- testsuite/rust/compile
4 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2798 | 2798 | | |
2799 | 2799 | | |
2800 | 2800 | | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
2801 | 2806 | | |
2802 | 2807 | | |
2803 | 2808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
0 commit comments