Repository navigation
cg_llvm: Avoid all remaining uses of as_c_char_ptr - #164071
Merged
Merged
Conversation
Collaborator
|
Some changes occurred in compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs cc @ZuseZ4 |
Collaborator
|
r? @oli-obk rustbot has assigned @oli-obk. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
|
r? me @bors r+ rollup |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 10, 2026
Rollup merge of #164071 - Zalathar:as-c-char-ptr, r=hanna-kruppe cg_llvm: Avoid all remaining uses of `as_c_char_ptr` Follow-up to: - #163789 - #164017 --- As explained in the previous PRs (and in the comments for `PTR_LEN_STR`), we can avoid the need for these casts by declaring the relevant FFI bindings to take `*const c_uchar`, which has the same ABI as `*const c_char`. This is more convenient at the call site, and makes it harder to mix up pointer/length strings and nul-terminated strings. There should be no change to compiler output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to:
as_c_char_ptrin several places #163789*const c_char#164017As explained in the previous PRs (and in the comments for
PTR_LEN_STR), we can avoid the need for these casts by declaring the relevant FFI bindings to take*const c_uchar, which has the same ABI as*const c_char. This is more convenient at the call site, and makes it harder to mix up pointer/length strings and nul-terminated strings.There should be no change to compiler output.