about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatt Ickstadt <mattico8@gmail.com>2017-02-11 15:41:03 -0600
committerMatt Ickstadt <mattico8@gmail.com>2017-02-11 15:41:03 -0600
commitaebce5bd2aa9f75b09fc30638736e14761989fce (patch)
tree74e598a972d49d1c568f434d00496ef0fca54066
parent68fff6254286bcee426fd9020c54f8f30b64758e (diff)
downloadrust-aebce5bd2aa9f75b09fc30638736e14761989fce.tar.gz
rust-aebce5bd2aa9f75b09fc30638736e14761989fce.zip
Fix as_ptr() drop problem
-rw-r--r--src/librustc_trans/debuginfo/metadata.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs
index 21279afb410..c453d9bbd05 100644
--- a/src/librustc_trans/debuginfo/metadata.rs
+++ b/src/librustc_trans/debuginfo/metadata.rs
@@ -787,20 +787,20 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
                            (option_env!("CFG_VERSION")).expect("CFG_VERSION"));
 
     let compile_unit_name = compile_unit_name.as_ptr();
-    let work_dir = path2cstr(&work_dir).as_ptr();
-    let producer = CString::new(producer).unwrap().as_ptr();
+    let work_dir = path2cstr(&work_dir);
+    let producer = CString::new(producer).unwrap();
     let flags = "\0";
     let split_name = "\0";
 
     unsafe {
         let file_metadata = llvm::LLVMRustDIBuilderCreateFile(
-            debug_context.builder, compile_unit_name, work_dir);
+            debug_context.builder, compile_unit_name, work_dir.as_ptr());
 
         return llvm::LLVMRustDIBuilderCreateCompileUnit(
             debug_context.builder,
             DW_LANG_RUST,
             file_metadata,
-            producer,
+            producer.as_ptr(),
             sess.opts.optimize != config::OptLevel::No,
             flags.as_ptr() as *const _,
             0,