Commit a36a534
Fix enum-drop of aggregate mutable-reference fields (#167)
* Fix enum-drop of aggregate mutable-reference fields
Dropping a value whose enum variant holds an aggregate of mutable
references (e.g. `Pair::Two((&mut i32, &mut i32))`, or the
`Option<(&mut T, &mut [T])>` returned by `split_first_mut`) panicked in
`refine/env.rs` with `assert!(assumption_existentials.is_empty())`. The
enum-drop path built each field's drop assumption by re-deriving it
through a fresh `Path`, but projecting an aggregate field
(`PlaceType::tuple_proj`/`deref`) allocates fresh existentials, so the
recursive call returned an assumption with existentials the assert
never expected. Minimum repro:
enum Pair<'a> {
Two((&'a mut i32, &'a mut i32)),
None,
}
#[thrust::callable]
fn check(a: &mut i32, b: &mut i32) {
let _p = Pair::Two((a, b));
}
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmZGoGNQRhg6aZsGhhSaDF
* fixup! Fix enum-drop of aggregate mutable-reference fields
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent aa0d081 commit a36a534
3 files changed
Lines changed: 91 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1050 | 1050 | | |
1051 | 1051 | | |
1052 | 1052 | | |
1053 | | - | |
1054 | 1053 | | |
1055 | 1054 | | |
1056 | 1055 | | |
| |||
1079 | 1078 | | |
1080 | 1079 | | |
1081 | 1080 | | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | 1081 | | |
1093 | 1082 | | |
1094 | 1083 | | |
1095 | 1084 | | |
1096 | 1085 | | |
1097 | 1086 | | |
1098 | | - | |
1099 | 1087 | | |
1100 | 1088 | | |
1101 | 1089 | | |
| |||
1111 | 1099 | | |
1112 | 1100 | | |
1113 | 1101 | | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
1127 | 1136 | | |
1128 | 1137 | | |
1129 | 1138 | | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | 1139 | | |
1138 | 1140 | | |
1139 | 1141 | | |
1140 | 1142 | | |
| 1143 | + | |
1141 | 1144 | | |
1142 | | - | |
1143 | | - | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1144 | 1148 | | |
1145 | | - | |
| 1149 | + | |
1146 | 1150 | | |
1147 | 1151 | | |
1148 | 1152 | | |
1149 | 1153 | | |
1150 | 1154 | | |
1151 | 1155 | | |
1152 | 1156 | | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1181 | 1162 | | |
1182 | 1163 | | |
1183 | 1164 | | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
| 1165 | + | |
| 1166 | + | |
1187 | 1167 | | |
1188 | | - | |
| 1168 | + | |
1189 | 1169 | | |
1190 | 1170 | | |
1191 | 1171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments