about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-05 19:40:23 +0200
committerGitHub <noreply@github.com>2025-04-05 19:40:23 +0200
commit0b342873e3d8271d89ac1b959482526f8a441858 (patch)
treef700421e25d80fe7f35f75e39ef6a540b9961718 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent0c478fdfe138a8b09744798c85fe2be657768b00 (diff)
parent7bca1f2675d9f63b09ed9641e9aefe05b8ccc675 (diff)
downloadrust-0b342873e3d8271d89ac1b959482526f8a441858.tar.gz
rust-0b342873e3d8271d89ac1b959482526f8a441858.zip
Rollup merge of #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: #83164
`ptr::replace` constified in #83091
`ptr::replace` const stabilized in #130954

[^1]: `const_replace` FCP completed: https://github.com/rust-lang/rust/issues/83164#issuecomment-2385670050
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions