diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-18 21:43:37 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-20 17:08:05 +1100 |
| commit | 3310419d35c51b4da14c2fee9c0dcfab6b66ea0d (patch) | |
| tree | 2c1869d1ece466cbc22ae3f9cb88bfccbc083f88 /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | d68c32779627fcd72a928c9e89f65094dbcf7482 (diff) | |
| download | rust-3310419d35c51b4da14c2fee9c0dcfab6b66ea0d.tar.gz rust-3310419d35c51b4da14c2fee9c0dcfab6b66ea0d.zip | |
Make `llvm::set_section` take a `&CStr`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/mod.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs index b306396e15a..e837022044e 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs @@ -210,10 +210,9 @@ impl MemoryEffects { } } -pub fn set_section(llglobal: &Value, section_name: &str) { - let section_name_cstr = CString::new(section_name).expect("unexpected CString error"); +pub fn set_section(llglobal: &Value, section_name: &CStr) { unsafe { - LLVMSetSection(llglobal, section_name_cstr.as_ptr()); + LLVMSetSection(llglobal, section_name.as_ptr()); } } |
