Skip to content

Commit 7c6adb4

Browse files
committed
fixed errors
1 parent c97aa09 commit 7c6adb4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_trans/llvm_util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use llvm;
1414
use rustc::session::Session;
1515
use rustc::session::config::PrintRequest;
1616
use libc::c_int;
17-
use std::ffi::{CStr, CString};
17+
use std::ffi::CString;
1818

1919
use std::sync::atomic::{AtomicBool, Ordering};
2020
use std::sync::Once;
@@ -118,14 +118,14 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> {
118118
.iter()
119119
.filter(|feature| {
120120
let llvm_feature = to_llvm_feature(feature);
121-
let ptr = CString::new(llvm_feature).as_ptr();
121+
let ptr = CString::new(llvm_feature).unwrap().as_ptr();
122122
unsafe { llvm::LLVMRustHasFeature(target_machine, ptr) }
123123
})
124-
.map(Symbol::intern).collect()
124+
.map(|feature| Symbol::intern(feature)).collect()
125125
}
126126

127127
pub fn target_feature_whitelist(sess: &Session) -> &'static [&'static str] {
128-
let whitelist = match &*sess.target.target.arch {
128+
match &*sess.target.target.arch {
129129
"arm" => ARM_WHITELIST,
130130
"aarch64" => AARCH64_WHITELIST,
131131
"x86" | "x86_64" => X86_WHITELIST,

0 commit comments

Comments
 (0)