Commit 8e42f01
authored
Rollup merge of rust-lang#55060 - jannic:patch-1, r=joshtriplett
clarify pointer add/sub function safety concerns
Ralf Jung made the same changes to the offset functions' documentation
in commit fb08915. As add/sub just call offset, the same limitation
applies here, as well.
I did not copy the whole explanation ("In particular, the resulting pointer may *not* be used to access a different allocated object [...]") because I'd consider that as being too repetitive. The documentation of add/sub already refers to the offset function, so people interested in the details can look it up, there.
But changing 'an object' to 'the same object' is a small change which improves clarity a lot.1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
| 1040 | + | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
| |||
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
1258 | | - | |
| 1258 | + | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
| |||
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
1315 | | - | |
| 1315 | + | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
| |||
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
1660 | | - | |
| 1660 | + | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | 1663 | | |
| |||
1893 | 1893 | | |
1894 | 1894 | | |
1895 | 1895 | | |
1896 | | - | |
| 1896 | + | |
1897 | 1897 | | |
1898 | 1898 | | |
1899 | 1899 | | |
| |||
1950 | 1950 | | |
1951 | 1951 | | |
1952 | 1952 | | |
1953 | | - | |
| 1953 | + | |
1954 | 1954 | | |
1955 | 1955 | | |
1956 | 1956 | | |
| |||
0 commit comments