Commit da143d3
authored
Rollup merge of rust-lang#82554 - SkiFire13:fix-string-retain-unsoundness, r=m-ou-se
Fix invalid slice access in String::retain
As noted in rust-lang#78499, the previous fix was technically still unsound because it accessed elements of a slice outside its bounds (even though they were still inside the same allocation). This PR addresses that concern by switching to a dropguard approach.1 file changed
+22
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1289 | 1289 | | |
1290 | 1290 | | |
1291 | 1291 | | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
1295 | 1297 | | |
1296 | | - | |
1297 | | - | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
1298 | 1304 | | |
1299 | 1305 | | |
1300 | | - | |
1301 | | - | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1302 | 1311 | | |
1303 | 1312 | | |
1304 | 1313 | | |
1305 | | - | |
1306 | | - | |
| 1314 | + | |
| 1315 | + | |
1307 | 1316 | | |
1308 | 1317 | | |
1309 | | - | |
1310 | | - | |
| 1318 | + | |
| 1319 | + | |
1311 | 1320 | | |
1312 | 1321 | | |
1313 | 1322 | | |
1314 | 1323 | | |
1315 | 1324 | | |
1316 | 1325 | | |
1317 | | - | |
| 1326 | + | |
1318 | 1327 | | |
1319 | 1328 | | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
| 1329 | + | |
1323 | 1330 | | |
1324 | 1331 | | |
1325 | 1332 | | |
| |||
0 commit comments