Skip to content

Commit aebce5b

Browse files
committed
Fix as_ptr() drop problem
1 parent 68fff62 commit aebce5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_trans/debuginfo/metadata.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -787,20 +787,20 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
787787
(option_env!("CFG_VERSION")).expect("CFG_VERSION"));
788788

789789
let compile_unit_name = compile_unit_name.as_ptr();
790-
let work_dir = path2cstr(&work_dir).as_ptr();
791-
let producer = CString::new(producer).unwrap().as_ptr();
790+
let work_dir = path2cstr(&work_dir);
791+
let producer = CString::new(producer).unwrap();
792792
let flags = "\0";
793793
let split_name = "\0";
794794

795795
unsafe {
796796
let file_metadata = llvm::LLVMRustDIBuilderCreateFile(
797-
debug_context.builder, compile_unit_name, work_dir);
797+
debug_context.builder, compile_unit_name, work_dir.as_ptr());
798798

799799
return llvm::LLVMRustDIBuilderCreateCompileUnit(
800800
debug_context.builder,
801801
DW_LANG_RUST,
802802
file_metadata,
803-
producer,
803+
producer.as_ptr(),
804804
sess.opts.optimize != config::OptLevel::No,
805805
flags.as_ptr() as *const _,
806806
0,

0 commit comments

Comments
 (0)