Commit 37645bd
committed
Guarantee that as_slice_memory_order_mut preserves strides
This fixes bugs in `.map_mut()` and `.zip_mut_with_same_shape()`.
Before this commit, strides obtained before calling
`.as_slice_memory_order_mut()` could not be used to correctly
interpret the data in the returned slice. Now, the strides are
preserved, so the implementations of `.map_mut()` and
`.zip_mut_with_same_shape()` work correctly. This also makes it much
easier for users of the crate to use `.as_slice_memory_order_mut()`
correctly in generic code.
Fixes #1018.1 parent 15b0808 commit 37645bd
3 files changed
+50
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
241 | 239 | | |
242 | 240 | | |
243 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1539 | 1543 | | |
1540 | 1544 | | |
1541 | 1545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
994 | | - | |
| 993 | + | |
| 994 | + | |
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| |||
1000 | 1000 | | |
1001 | 1001 | | |
1002 | 1002 | | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1003 | 1035 | | |
1004 | 1036 | | |
1005 | 1037 | | |
| |||
1809 | 1841 | | |
1810 | 1842 | | |
1811 | 1843 | | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
1812 | 1848 | | |
1813 | 1849 | | |
1814 | 1850 | | |
| |||
0 commit comments