diff --git a/src/librustc_driver/target_features.rs b/src/librustc_driver/target_features.rs index 69d146059c9c0..fad0af19a1270 100644 --- a/src/librustc_driver/target_features.rs +++ b/src/librustc_driver/target_features.rs @@ -54,6 +54,7 @@ pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) { let tf = InternedString::new("target_feature"); for feat in whitelist { + assert_eq!(feat.chars().last(), Some('\0')); if unsafe { LLVMRustHasFeature(target_machine, feat.as_ptr() as *const c_char) } { cfg.push(attr::mk_name_value_item_str(tf.clone(), intern(&feat[..feat.len()-1]))) }