diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs index 1f921513fe628..b25562252e72e 100644 --- a/src/librustc_trans/llvm_util.rs +++ b/src/librustc_trans/llvm_util.rs @@ -118,8 +118,8 @@ pub fn target_features(sess: &Session) -> Vec { .iter() .filter(|feature| { let llvm_feature = to_llvm_feature(feature); - let ptr = CString::new(llvm_feature).unwrap().as_ptr(); - unsafe { llvm::LLVMRustHasFeature(target_machine, ptr) } + let cstr = CString::new(llvm_feature).unwrap(); + unsafe { llvm::LLVMRustHasFeature(target_machine, cstr.as_ptr()) } }) .map(|feature| Symbol::intern(feature)).collect() }