File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
compiler/rustc_codegen_llvm/src/llvm Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1+ //! Bindings to the LLVM-C API (`LLVM*`), and to our own `extern "C"` wrapper
2+ //! functions around the unstable LLVM C++ API (`LLVMRust*`).
3+ //!
4+ //! ## Passing pointer/length strings as `*const c_uchar`
5+ //!
6+ //! Normally it's a good idea for Rust-side bindings to match the corresponding
7+ //! C-side function declarations as closely as possible. But when passing `&str`
8+ //! or `&[u8]` data as a pointer/length pair, it's more convenient to declare
9+ //! the Rust-side pointer as `*const c_uchar` instead of `*const c_char`.
10+ //! Both pointer types have the same ABI, and using `*const c_uchar` avoids
11+ //! the need for an extra cast from `*const u8` on the Rust side.
12+
113#![ allow( non_camel_case_types) ]
214#![ allow( non_upper_case_globals) ]
315
You can’t perform that action at this time.
0 commit comments