Querify global_backend_features
At the very least this serves to deduplicate the diagnostics that are output about unknown target features provided via CLI.
This commit is contained in:
parent
c97c216efd
commit
df701a292c
10 changed files with 58 additions and 48 deletions
|
@ -66,3 +66,15 @@ impl Deref for SmallCStr {
|
|||
self.as_c_str()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromIterator<&'a str> for SmallCStr {
|
||||
fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self {
|
||||
let mut data =
|
||||
iter.into_iter().flat_map(|s| s.as_bytes()).copied().collect::<SmallVec<_>>();
|
||||
data.push(0);
|
||||
if let Err(e) = ffi::CStr::from_bytes_with_nul(&data) {
|
||||
panic!("The iterator {:?} cannot be converted into a CStr: {}", data, e);
|
||||
}
|
||||
Self { data }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue