Commit 860ae72
committed
gccrs: track abi and unsafety on fnptrs for proper type checking
We need to distinguish between abi's and unsafety on fnptrs. There is
a commented out check because there is a regression in:
rust/compile/try-catch-unwind-{new/old}.rs
But i think this is because the test case should be taking an FnOnce
from reading std::panic in rust 1.49. Where as we are passing an fnptr
which is probably because we didnt support fnonce at all then.
Addresses #4090
gcc/rust/ChangeLog:
* hir/tree/rust-hir-item.h: add unsafe helper
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): pass in abi and unsafe
* typecheck/rust-tyty.cc (BaseType::monomorphized_clone): likewise
(FnPtr::as_string): emit more info
(FnPtr::clone): update ctor call
* typecheck/rust-tyty.h: new ctor params
* typecheck/rust-unify.cc (UnifyRules::expect_fnptr): check abi and unsafe
Signed-off-by: Philip Herron <herron.philip@googlemail.com>1 parent b7c9aaa commit 860ae72
File tree
5 files changed
+60
-12
lines changed- gcc/rust
- hir/tree
- typecheck
5 files changed
+60
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
455 | 456 | | |
456 | 457 | | |
457 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
612 | | - | |
| 611 | + | |
| 612 | + | |
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
| |||
2268 | 2268 | | |
2269 | 2269 | | |
2270 | 2270 | | |
2271 | | - | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
2272 | 2278 | | |
2273 | 2279 | | |
2274 | 2280 | | |
| |||
2304 | 2310 | | |
2305 | 2311 | | |
2306 | 2312 | | |
2307 | | - | |
2308 | | - | |
| 2313 | + | |
| 2314 | + | |
2309 | 2315 | | |
2310 | 2316 | | |
2311 | 2317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | | - | |
| 1049 | + | |
| 1050 | + | |
1050 | 1051 | | |
1051 | 1052 | | |
1052 | 1053 | | |
1053 | | - | |
| 1054 | + | |
| 1055 | + | |
1054 | 1056 | | |
1055 | 1057 | | |
1056 | 1058 | | |
1057 | | - | |
| 1059 | + | |
| 1060 | + | |
1058 | 1061 | | |
1059 | 1062 | | |
1060 | 1063 | | |
1061 | | - | |
| 1064 | + | |
1062 | 1065 | | |
1063 | 1066 | | |
1064 | 1067 | | |
| |||
1094 | 1097 | | |
1095 | 1098 | | |
1096 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1097 | 1104 | | |
1098 | 1105 | | |
1099 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
1100 | 1109 | | |
1101 | 1110 | | |
1102 | 1111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1146 | 1146 | | |
1147 | 1147 | | |
1148 | 1148 | | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1149 | 1159 | | |
1150 | 1160 | | |
1151 | 1161 | | |
| |||
1183 | 1193 | | |
1184 | 1194 | | |
1185 | 1195 | | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1186 | 1215 | | |
1187 | 1216 | | |
1188 | 1217 | | |
| |||
0 commit comments