Commit 66dac34
authored
Rollup merge of rust-lang#136877 - Sky9x:const-inherent-ptr-replace, r=jhpratt
Fix missing const for inherent pointer `replace` methods
`ptr::replace` (the free fn) is already const stable. However, there are inherent convenience methods on `*mut T` and `NonNull<T>`, allowing you to write eg. `unsafe { foo.replace(bar) }` where `foo` is `*mut T` or `NonNull<T>`.
It seems const was never added to the inherent method (likely oversight), so this PR adds it.
I don't believe this needs another[^1] FCP as the inherent methods are already stable and `ptr::replace` is already const stable, so this adds no new API.
Original tracking issue: rust-lang#83164
`ptr::replace` constified in rust-lang#83091
`ptr::replace` const stabilized in rust-lang#130954
[^1]: `const_replace` FCP completed: rust-lang#83164 (comment)2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1574 | 1574 | | |
1575 | 1575 | | |
1576 | 1576 | | |
| 1577 | + | |
1577 | 1578 | | |
1578 | | - | |
| 1579 | + | |
1579 | 1580 | | |
1580 | 1581 | | |
1581 | 1582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1166 | 1166 | | |
1167 | 1167 | | |
1168 | 1168 | | |
1169 | | - | |
| 1169 | + | |
| 1170 | + | |
1170 | 1171 | | |
1171 | 1172 | | |
1172 | 1173 | | |
| |||
0 commit comments