diff --git a/dev-tools/gen-target-info/src/main.rs b/dev-tools/gen-target-info/src/main.rs index 27d8bd3c8..95f856376 100644 --- a/dev-tools/gen-target-info/src/main.rs +++ b/dev-tools/gen-target-info/src/main.rs @@ -12,9 +12,11 @@ const PRELUDE: &str = r#"//! This file is generated code. Please edit the genera fn generate_target_mapping(f: &mut File, target_specs: &RustcTargetSpecs) -> std::io::Result<()> { writeln!(f, "use super::TargetInfo;")?; - writeln!(f, "use std::borrow::Cow;")?; writeln!(f)?; - writeln!(f, "pub(crate) const LIST: &[(&str, TargetInfo)] = &[")?; + writeln!( + f, + "pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[" + )?; for (triple, spec) in &target_specs.0 { let full_arch = triple.split_once('-').unwrap().0; @@ -42,15 +44,15 @@ fn generate_target_mapping(f: &mut File, target_specs: &RustcTargetSpecs) -> std writeln!(f, " (")?; writeln!(f, " {triple:?},")?; writeln!(f, " TargetInfo {{")?; - writeln!(f, " full_arch: Cow::Borrowed({full_arch:?}),")?; - writeln!(f, " arch: Cow::Borrowed({arch:?}),")?; - writeln!(f, " vendor: Cow::Borrowed({vendor:?}),")?; - writeln!(f, " os: Cow::Borrowed({os:?}),")?; - writeln!(f, " env: Cow::Borrowed({env:?}),")?; - writeln!(f, " abi: Cow::Borrowed({abi:?}),")?; + writeln!(f, " full_arch: {full_arch:?},")?; + writeln!(f, " arch: {arch:?},")?; + writeln!(f, " vendor: {vendor:?},")?; + writeln!(f, " os: {os:?},")?; + writeln!(f, " env: {env:?},")?; + writeln!(f, " abi: {abi:?},")?; writeln!( f, - " unversioned_llvm_target: Cow::Borrowed({unversioned_llvm_target:?})," + " unversioned_llvm_target: {unversioned_llvm_target:?}," )?; writeln!(f, " }},")?; writeln!(f, " ),")?; diff --git a/src/lib.rs b/src/lib.rs index b08540de9..c2110822d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -259,6 +259,16 @@ struct CompilerFlag { type Env = Option>; +#[derive(Debug, Default)] +struct BuildCache { + env_cache: RwLock, Env>>, + apple_sdk_root_cache: RwLock, Arc>>, + apple_versions_cache: RwLock, Arc>>, + cached_compiler_family: RwLock, ToolFamily>>, + known_flag_support_status_cache: RwLock>, + target_info_parser: target::TargetInfoParser, +} + /// A builder for compilation of a native library. /// /// A `Build` is the main type of the `cc` crate and is used to control all the @@ -271,7 +281,6 @@ pub struct Build { objects: Vec>, flags: Vec>, flags_supported: Vec>, - known_flag_support_status_cache: Arc>>, ar_flags: Vec>, asm_flags: Vec>, no_default_flags: bool, @@ -306,12 +315,9 @@ pub struct Build { warnings_into_errors: bool, warnings: Option, extra_warnings: Option, - env_cache: Arc, Env>>>, - apple_sdk_root_cache: Arc, Arc>>>, - apple_versions_cache: Arc, Arc>>>, emit_rerun_if_env_changed: bool, - cached_compiler_family: Arc, ToolFamily>>>, shell_escaped_flags: Option, + build_cache: Arc, } /// Represents the types of errors that may occur while using cc-rs. @@ -399,7 +405,6 @@ impl Build { objects: Vec::new(), flags: Vec::new(), flags_supported: Vec::new(), - known_flag_support_status_cache: Arc::new(RwLock::new(HashMap::new())), ar_flags: Vec::new(), asm_flags: Vec::new(), no_default_flags: false, @@ -431,12 +436,9 @@ impl Build { warnings: None, extra_warnings: None, warnings_into_errors: false, - env_cache: Arc::new(RwLock::new(HashMap::new())), - apple_sdk_root_cache: Arc::new(RwLock::new(HashMap::new())), - apple_versions_cache: Arc::new(RwLock::new(HashMap::new())), emit_rerun_if_env_changed: true, - cached_compiler_family: Arc::default(), shell_escaped_flags: None, + build_cache: Arc::default(), } } @@ -634,7 +636,7 @@ impl Build { &self, flag: &OsStr, compiler_path: &Path, - target: &TargetInfo, + target: &TargetInfo<'_>, ) -> Result { let compiler_flag = CompilerFlag { compiler: compiler_path.into(), @@ -642,6 +644,7 @@ impl Build { }; if let Some(is_supported) = self + .build_cache .known_flag_support_status_cache .read() .unwrap() @@ -686,7 +689,7 @@ impl Build { } let mut cmd = compiler.to_command(); - let is_arm = matches!(&*target.arch, "aarch64" | "arm"); + let is_arm = matches!(target.arch, "aarch64" | "arm"); let clang = compiler.is_like_clang(); let gnu = compiler.family == ToolFamily::Gnu; command_add_output_file( @@ -711,7 +714,8 @@ impl Build { let output = cmd.output()?; let is_supported = output.status.success() && output.stderr.is_empty(); - self.known_flag_support_status_cache + self.build_cache + .known_flag_support_status_cache .write() .unwrap() .insert(compiler_flag, is_supported); @@ -1433,7 +1437,7 @@ impl Build { libtst = true; } else if cfg!(target_env = "msvc") { libdir.push("lib"); - match &*target.arch { + match target.arch { "x86_64" => { libdir.push("x64"); libtst = true; @@ -1725,7 +1729,7 @@ impl Build { .map(Cow::Owned)?, ) }; - let is_arm = matches!(&*target.arch, "aarch64" | "arm"); + let is_arm = matches!(target.arch, "aarch64" | "arm"); command_add_output_file( &mut cmd, &obj.dst, @@ -1932,7 +1936,7 @@ impl Build { fn add_default_flags( &self, cmd: &mut Tool, - target: &TargetInfo, + target: &TargetInfo<'_>, opt_level: &str, ) -> Result<(), Error> { let raw_target = self.get_raw_target()?; @@ -2290,7 +2294,7 @@ impl Build { // get the 32i/32imac/32imc/64gc/64imac/... part let arch = &target.full_arch[5..]; if arch.starts_with("64") { - if matches!(&*target.os, "linux" | "freebsd" | "netbsd") { + if matches!(target.os, "linux" | "freebsd" | "netbsd") { cmd.args.push(("-march=rv64gc").into()); cmd.args.push("-mabi=lp64d".into()); } else { @@ -2528,7 +2532,7 @@ impl Build { fn apple_flags(&self, cmd: &mut Tool) -> Result<(), Error> { let target = self.get_target()?; - let arch_str = &*target.full_arch; + let arch_str = target.full_arch; let arch = if target.os == "macos" { match arch_str { @@ -2582,7 +2586,7 @@ impl Build { } }; - let sdk_details = apple_os_sdk_parts(&target.os, &arch); + let sdk_details = apple_os_sdk_parts(target.os, &arch); let min_version = self.apple_deployment_target(&target); match arch { @@ -2684,7 +2688,7 @@ impl Build { if let Some(c) = &self.compiler { return Ok(Tool::new( (**c).to_owned(), - &self.cached_compiler_family, + &self.build_cache.cached_compiler_family, &self.cargo_output, out_dir, )); @@ -2725,7 +2729,7 @@ impl Build { let mut t = Tool::with_clang_driver( tool, driver_mode, - &self.cached_compiler_family, + &self.build_cache.cached_compiler_family, &self.cargo_output, out_dir, ); @@ -2752,7 +2756,7 @@ impl Build { } else { Some(Tool::new( PathBuf::from(tool), - &self.cached_compiler_family, + &self.build_cache.cached_compiler_family, &self.cargo_output, out_dir, )) @@ -2817,7 +2821,7 @@ impl Build { let mut t = Tool::new( PathBuf::from(compiler), - &self.cached_compiler_family, + &self.build_cache.cached_compiler_family, &self.cargo_output, out_dir, ); @@ -2841,7 +2845,7 @@ impl Build { nvcc, None, self.cuda, - &self.cached_compiler_family, + &self.build_cache.cached_compiler_family, &self.cargo_output, out_dir, ); @@ -3466,10 +3470,13 @@ impl Build { .or_else(|| prefixes.first().copied()) } - fn get_target(&self) -> Result { + fn get_target(&self) -> Result, Error> { match &self.target { Some(t) => t.parse(), - None => TargetInfo::from_cargo_environment_variables(), + None => self + .build_cache + .target_info_parser + .parse_from_cargo_environment_variables(), } } @@ -3509,7 +3516,7 @@ impl Build { // Tentatively matches the DWARF version defaults as of rustc 1.62. let target = self.get_target().ok()?; if matches!( - &*target.os, + target.os, "android" | "dragonfly" | "freebsd" | "netbsd" | "openbsd" ) || target.vendor == "apple" || (target.os == "windows" && target.env == "gnu") @@ -3559,7 +3566,7 @@ impl Build { _ => false, } } - if let Some(val) = self.env_cache.read().unwrap().get(v).cloned() { + if let Some(val) = self.build_cache.env_cache.read().unwrap().get(v).cloned() { return val; } // Excluding `PATH` prevents spurious rebuilds on Windows, see @@ -3574,7 +3581,11 @@ impl Build { v, OptionOsStrDisplay(r.as_deref()) )); - self.env_cache.write().unwrap().insert(v.into(), r.clone()); + self.build_cache + .env_cache + .write() + .unwrap() + .insert(v.into(), r.clone()); r } @@ -3710,6 +3721,7 @@ impl Build { fn apple_sdk_root(&self, sdk: &str) -> Result, Error> { if let Some(ret) = self + .build_cache .apple_sdk_root_cache .read() .expect("apple_sdk_root_cache lock failed") @@ -3719,16 +3731,18 @@ impl Build { return Ok(ret); } let sdk_path = self.apple_sdk_root_inner(sdk)?; - self.apple_sdk_root_cache + self.build_cache + .apple_sdk_root_cache .write() .expect("apple_sdk_root_cache lock failed") .insert(sdk.into(), sdk_path.clone()); Ok(sdk_path) } - fn apple_deployment_target(&self, target: &TargetInfo) -> Arc { + fn apple_deployment_target(&self, target: &TargetInfo<'_>) -> Arc { let sdk = target.apple_sdk_name(); if let Some(ret) = self + .build_cache .apple_versions_cache .read() .expect("apple_versions_cache lock failed") @@ -3778,7 +3792,7 @@ impl Build { .split('.') .map(|v| v.parse::().expect("integer version")); - match &*target.os { + match target.os { "macos" => { let major = deployment_target.next().unwrap_or(0); let minor = deployment_target.next().unwrap_or(0); @@ -3823,7 +3837,7 @@ impl Build { // // The ordering of env -> XCode SDK -> old rustc defaults is intentional for performance when using // an explicit target. - let version: Arc = match &*target.os { + let version: Arc = match target.os { "macos" => deployment_from_env("MACOSX_DEPLOYMENT_TARGET") .and_then(maybe_cpp_version_baseline) .or_else(default_deployment_from_sdk) @@ -3856,7 +3870,8 @@ impl Build { os => unreachable!("unknown Apple OS: {}", os), }; - self.apple_versions_cache + self.build_cache + .apple_versions_cache .write() .expect("apple_versions_cache lock failed") .insert(sdk.into(), version.clone()); @@ -3930,12 +3945,12 @@ impl Build { None } - fn windows_registry_find(&self, target: &TargetInfo, tool: &str) -> Option { + fn windows_registry_find(&self, target: &TargetInfo<'_>, tool: &str) -> Option { self.windows_registry_find_tool(target, tool) .map(|c| c.to_command()) } - fn windows_registry_find_tool(&self, target: &TargetInfo, tool: &str) -> Option { + fn windows_registry_find_tool(&self, target: &TargetInfo<'_>, tool: &str) -> Option { struct BuildEnvGetter<'s>(&'s Build); impl windows_registry::EnvGetter for BuildEnvGetter<'_> { @@ -4074,8 +4089,8 @@ fn autodetect_android_compiler(raw_target: &str, gnu: &str, clang: &str) -> Stri } // Rust and clang/cc don't agree on how to name the target. -fn map_darwin_target_from_rust_to_compiler_architecture(target: &TargetInfo) -> &str { - match &*target.full_arch { +fn map_darwin_target_from_rust_to_compiler_architecture<'a>(target: &TargetInfo<'a>) -> &'a str { + match target.full_arch { "aarch64" => "arm64", "arm64_32" => "arm64_32", "arm64e" => "arm64e", diff --git a/src/parallel/job_token.rs b/src/parallel/job_token.rs index 2640cea6c..5528e1f8b 100644 --- a/src/parallel/job_token.rs +++ b/src/parallel/job_token.rs @@ -1,8 +1,6 @@ use std::marker::PhantomData; -use crate::Error; - -use super::once_lock::OnceLock; +use crate::{utilities::OnceLock, Error}; pub(crate) struct JobToken(PhantomData<()>); diff --git a/src/parallel/mod.rs b/src/parallel/mod.rs index 70a56e74d..019eae102 100644 --- a/src/parallel/mod.rs +++ b/src/parallel/mod.rs @@ -1,4 +1,3 @@ pub(crate) mod async_executor; pub(crate) mod job_token; -pub(crate) mod once_lock; pub(crate) mod stderr; diff --git a/src/parallel/once_lock.rs b/src/parallel/once_lock.rs deleted file mode 100644 index c48dbb72e..000000000 --- a/src/parallel/once_lock.rs +++ /dev/null @@ -1,47 +0,0 @@ -use std::{ - cell::UnsafeCell, - marker::PhantomData, - mem::MaybeUninit, - panic::{RefUnwindSafe, UnwindSafe}, - sync::Once, -}; - -pub(crate) struct OnceLock { - once: Once, - value: UnsafeCell>, - _marker: PhantomData, -} - -impl OnceLock { - pub(crate) const fn new() -> Self { - Self { - once: Once::new(), - value: UnsafeCell::new(MaybeUninit::uninit()), - _marker: PhantomData, - } - } - - pub(crate) fn get_or_init(&self, f: impl FnOnce() -> T) -> &T { - self.once.call_once(|| { - unsafe { &mut *self.value.get() }.write(f()); - }); - unsafe { (&*self.value.get()).assume_init_ref() } - } -} - -unsafe impl Sync for OnceLock {} -unsafe impl Send for OnceLock {} - -impl RefUnwindSafe for OnceLock {} -impl UnwindSafe for OnceLock {} - -impl Drop for OnceLock { - #[inline] - fn drop(&mut self) { - if self.once.is_completed() { - // SAFETY: The cell is initialized and being dropped, so it can't - // be accessed again. - unsafe { self.value.get_mut().assume_init_drop() }; - } - } -} diff --git a/src/target.rs b/src/target.rs index 0f28e86ed..20fce3218 100644 --- a/src/target.rs +++ b/src/target.rs @@ -2,129 +2,52 @@ //! //! See the `target-lexicon` crate for a more principled approach to this. -use std::{borrow::Cow, env, str::FromStr}; +use std::str::FromStr; use crate::{Error, ErrorKind}; mod apple; mod generated; mod llvm; +mod parser; + +pub(crate) use parser::TargetInfoParser; /// Information specific to a `rustc` target. /// /// See . #[derive(Debug, PartialEq, Clone)] -pub(crate) struct TargetInfo { +pub(crate) struct TargetInfo<'a> { /// The full architecture, including the subarchitecture. /// /// This differs from `cfg!(target_arch)`, which only specifies the /// overall architecture, which is too coarse for certain cases. - pub full_arch: Cow<'static, str>, + pub full_arch: &'a str, /// The overall target architecture. /// /// This is the same as the value of `cfg!(target_arch)`. - pub arch: Cow<'static, str>, + pub arch: &'a str, /// The target vendor. /// /// This is the same as the value of `cfg!(target_vendor)`. - pub vendor: Cow<'static, str>, + pub vendor: &'a str, /// The operating system, or `none` on bare-metal targets. /// /// This is the same as the value of `cfg!(target_os)`. - pub os: Cow<'static, str>, + pub os: &'a str, /// The environment on top of the operating system. /// /// This is the same as the value of `cfg!(target_env)`. - pub env: Cow<'static, str>, + pub env: &'a str, /// The ABI on top of the operating system. /// /// This is the same as the value of `cfg!(target_abi)`. - pub abi: Cow<'static, str>, + pub abi: &'a str, /// The unversioned LLVM/Clang target triple. - unversioned_llvm_target: Cow<'static, str>, -} - -impl TargetInfo { - pub fn from_cargo_environment_variables() -> Result { - // `TARGET` must be present. - // - // No need to emit `rerun-if-env-changed` for this, - // as it is controlled by Cargo itself. - #[allow(clippy::disallowed_methods)] - let target_triple = env::var("TARGET").map_err(|err| { - Error::new( - ErrorKind::EnvVarNotFound, - format!("failed reading TARGET: {err}"), - ) - })?; - - // Parse the full architecture name from the target triple. - let (full_arch, _rest) = target_triple.split_once('-').ok_or(Error::new( - ErrorKind::InvalidTarget, - format!("target `{target_triple}` had an unknown architecture"), - ))?; - - let cargo_env = |name, fallback| { - // No need to emit `rerun-if-env-changed` for these, - // as they are controlled by Cargo itself. - #[allow(clippy::disallowed_methods)] - match env::var(name) { - Ok(var) => Ok(Cow::Owned(var)), - Err(err) => match fallback { - Some(fallback) => Ok(fallback), - None => Err(Error::new( - ErrorKind::EnvVarNotFound, - format!("did not find fallback information for target `{target_triple}`, and failed reading {name}: {err}"), - )), - }, - } - }; - - // Prefer to use `CARGO_ENV_*` if set, since these contain the most - // correct information relative to the current `rustc`, and makes it - // possible to support custom target JSON specs unknown to `rustc`. - // - // NOTE: If the user is using an older `rustc`, that data may be older - // than our pre-generated data, but we still prefer Cargo's view of - // the world, since at least `cc` won't differ from `rustc` in that - // case. - // - // These may not be set in case the user depended on being able to - // just set `TARGET` outside of build scripts; in those cases, fall - // back back to data from the known set of target triples instead. - // - // See discussion in #1225 for further details. - let fallback_target = TargetInfo::from_str(&target_triple).ok(); - let ft = fallback_target.as_ref(); - let arch = cargo_env("CARGO_CFG_TARGET_ARCH", ft.map(|t| t.arch.clone()))?; - let vendor = cargo_env("CARGO_CFG_TARGET_VENDOR", ft.map(|t| t.vendor.clone()))?; - let os = cargo_env("CARGO_CFG_TARGET_OS", ft.map(|t| t.os.clone()))?; - let env = cargo_env("CARGO_CFG_TARGET_ENV", ft.map(|t| t.env.clone()))?; - // `target_abi` was stabilized in Rust 1.78, which is higher than our - // MSRV, so it may not always be available; In that case, fall back to - // `""`, which is _probably_ correct for unknown target triples. - let abi = cargo_env("CARGO_CFG_TARGET_ABI", ft.map(|t| t.abi.clone())) - .unwrap_or(Cow::Borrowed("")); - - // Prefer `rustc`'s LLVM target triple information. - let unversioned_llvm_target = match fallback_target { - Some(ft) => ft.unversioned_llvm_target, - None => llvm::guess_llvm_target_triple(full_arch, &vendor, &os, &env, &abi).into(), - }; - - Ok(Self { - full_arch: full_arch.to_string().into(), - arch, - vendor, - os, - env, - abi, - unversioned_llvm_target, - }) - } + unversioned_llvm_target: &'a str, } -impl FromStr for TargetInfo { +impl FromStr for TargetInfo<'_> { type Err = Error; /// This will fail when using a custom target triple unknown to `rustc`. diff --git a/src/target/apple.rs b/src/target/apple.rs index f5ec1d857..7869aaaf9 100644 --- a/src/target/apple.rs +++ b/src/target/apple.rs @@ -1,8 +1,8 @@ use super::TargetInfo; -impl TargetInfo { +impl TargetInfo<'_> { pub(crate) fn apple_sdk_name(&self) -> &'static str { - match (&*self.os, &*self.abi) { + match (self.os, self.abi) { ("macos", "") => "macosx", ("ios", "") => "iphoneos", ("ios", "sim") => "iphonesimulator", diff --git a/src/target/generated.rs b/src/target/generated.rs index 0fa3ff3b6..ce3a4b072 100644 --- a/src/target/generated.rs +++ b/src/target/generated.rs @@ -2,3343 +2,3342 @@ //! in dev-tools/gen-target-info if you need to make changes. use super::TargetInfo; -use std::borrow::Cow; -pub(crate) const LIST: &[(&str, TargetInfo)] = &[ +pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[ ( "aarch64-apple-darwin", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("macos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-macosx"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "macos", + env: "", + abi: "", + unversioned_llvm_target: "arm64-apple-macosx", }, ), ( "aarch64-apple-ios", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-ios"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "ios", + env: "", + abi: "", + unversioned_llvm_target: "arm64-apple-ios", }, ), ( "aarch64-apple-ios-macabi", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("macabi"), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-ios-macabi"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "ios", + env: "", + abi: "macabi", + unversioned_llvm_target: "arm64-apple-ios-macabi", }, ), ( "aarch64-apple-ios-sim", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-ios-simulator"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "ios", + env: "", + abi: "sim", + unversioned_llvm_target: "arm64-apple-ios-simulator", }, ), ( "aarch64-apple-tvos", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("tvos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-tvos"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "tvos", + env: "", + abi: "", + unversioned_llvm_target: "arm64-apple-tvos", }, ), ( "aarch64-apple-tvos-sim", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("tvos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-tvos-simulator"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "tvos", + env: "", + abi: "sim", + unversioned_llvm_target: "arm64-apple-tvos-simulator", }, ), ( "aarch64-apple-visionos", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("visionos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-xros"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "visionos", + env: "", + abi: "", + unversioned_llvm_target: "arm64-apple-xros", }, ), ( "aarch64-apple-visionos-sim", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("visionos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-xros-simulator"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "visionos", + env: "", + abi: "sim", + unversioned_llvm_target: "arm64-apple-xros-simulator", }, ), ( "aarch64-apple-watchos", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("watchos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-watchos"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "watchos", + env: "", + abi: "", + unversioned_llvm_target: "arm64-apple-watchos", }, ), ( "aarch64-apple-watchos-sim", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("watchos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("arm64-apple-watchos-simulator"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "apple", + os: "watchos", + env: "", + abi: "sim", + unversioned_llvm_target: "arm64-apple-watchos-simulator", }, ), ( "aarch64-fuchsia", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("fuchsia"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-fuchsia"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "fuchsia", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-fuchsia", }, ), ( "aarch64-kmc-solid_asp3", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("kmc"), - os: Cow::Borrowed("solid_asp3"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-none"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "kmc", + os: "solid_asp3", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-none", }, ), ( "aarch64-linux-android", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-linux-android"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "android", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-linux-android", }, ), ( "aarch64-nintendo-switch-freestanding", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("nintendo"), - os: Cow::Borrowed("horizon"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-none"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "nintendo", + os: "horizon", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-none", }, ), ( "aarch64-pc-windows-gnullvm", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("llvm"), - unversioned_llvm_target: Cow::Borrowed("aarch64-pc-windows-gnu"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "pc", + os: "windows", + env: "gnu", + abi: "llvm", + unversioned_llvm_target: "aarch64-pc-windows-gnu", }, ), ( "aarch64-pc-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-pc-windows-msvc"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "pc", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "aarch64-pc-windows-msvc", }, ), ( "aarch64-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-freebsd"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-freebsd", }, ), ( "aarch64-unknown-fuchsia", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("fuchsia"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-fuchsia"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "fuchsia", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-fuchsia", }, ), ( "aarch64-unknown-hermit", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("hermit"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-hermit"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "hermit", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-hermit", }, ), ( "aarch64-unknown-illumos", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("illumos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-solaris2.11"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "illumos", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-solaris2.11", }, ), ( "aarch64-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-linux-gnu"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "aarch64-unknown-linux-gnu", }, ), ( "aarch64-unknown-linux-gnu_ilp32", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("ilp32"), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-linux-gnu_ilp32"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "ilp32", + unversioned_llvm_target: "aarch64-unknown-linux-gnu_ilp32", }, ), ( "aarch64-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-linux-musl"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "aarch64-unknown-linux-musl", }, ), ( "aarch64-unknown-linux-ohos", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("ohos"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-linux-ohos"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "linux", + env: "ohos", + abi: "", + unversioned_llvm_target: "aarch64-unknown-linux-ohos", }, ), ( "aarch64-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-netbsd"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-netbsd", }, ), ( "aarch64-unknown-none", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-none"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-none", }, ), ( "aarch64-unknown-none-softfloat", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("softfloat"), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-none"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "none", + env: "", + abi: "softfloat", + unversioned_llvm_target: "aarch64-unknown-none", }, ), ( "aarch64-unknown-nto-qnx700", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nto"), - env: Cow::Borrowed("nto70"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-unknown"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "nto", + env: "nto70", + abi: "", + unversioned_llvm_target: "aarch64-unknown-unknown", }, ), ( "aarch64-unknown-nto-qnx710", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nto"), - env: Cow::Borrowed("nto71"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-unknown"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "nto", + env: "nto71", + abi: "", + unversioned_llvm_target: "aarch64-unknown-unknown", }, ), ( "aarch64-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-openbsd"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-openbsd", }, ), ( "aarch64-unknown-redox", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("redox"), - env: Cow::Borrowed("relibc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-redox"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "redox", + env: "relibc", + abi: "", + unversioned_llvm_target: "aarch64-unknown-redox", }, ), ( "aarch64-unknown-teeos", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("teeos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-none"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "teeos", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-none", }, ), ( "aarch64-unknown-trusty", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("trusty"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-unknown-musl"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "trusty", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-unknown-musl", }, ), ( "aarch64-unknown-uefi", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("uefi"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-windows"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "unknown", + os: "uefi", + env: "", + abi: "", + unversioned_llvm_target: "aarch64-unknown-windows", }, ), ( "aarch64-uwp-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("uwp"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed("uwp"), - unversioned_llvm_target: Cow::Borrowed("aarch64-pc-windows-msvc"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "uwp", + os: "windows", + env: "msvc", + abi: "uwp", + unversioned_llvm_target: "aarch64-pc-windows-msvc", }, ), ( "aarch64-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("aarch64"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64-unknown-linux-gnu"), + full_arch: "aarch64", + arch: "aarch64", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "aarch64-unknown-linux-gnu", }, ), ( "aarch64_be-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("aarch64_be"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64_be-unknown-linux-gnu"), + full_arch: "aarch64_be", + arch: "aarch64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "aarch64_be-unknown-linux-gnu", }, ), ( "aarch64_be-unknown-linux-gnu_ilp32", TargetInfo { - full_arch: Cow::Borrowed("aarch64_be"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("ilp32"), - unversioned_llvm_target: Cow::Borrowed("aarch64_be-unknown-linux-gnu_ilp32"), + full_arch: "aarch64_be", + arch: "aarch64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "ilp32", + unversioned_llvm_target: "aarch64_be-unknown-linux-gnu_ilp32", }, ), ( "aarch64_be-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("aarch64_be"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("aarch64_be-unknown-netbsd"), + full_arch: "aarch64_be", + arch: "aarch64", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "aarch64_be-unknown-netbsd", }, ), ( "arm-linux-androideabi", TargetInfo { - full_arch: Cow::Borrowed("arm"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("arm-linux-androideabi"), + full_arch: "arm", + arch: "arm", + vendor: "unknown", + os: "android", + env: "", + abi: "eabi", + unversioned_llvm_target: "arm-linux-androideabi", }, ), ( "arm-unknown-linux-gnueabi", TargetInfo { - full_arch: Cow::Borrowed("arm"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("arm-unknown-linux-gnueabi"), + full_arch: "arm", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabi", + unversioned_llvm_target: "arm-unknown-linux-gnueabi", }, ), ( "arm-unknown-linux-gnueabihf", TargetInfo { - full_arch: Cow::Borrowed("arm"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("arm-unknown-linux-gnueabihf"), + full_arch: "arm", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabihf", + unversioned_llvm_target: "arm-unknown-linux-gnueabihf", }, ), ( "arm-unknown-linux-musleabi", TargetInfo { - full_arch: Cow::Borrowed("arm"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("arm-unknown-linux-gnueabi"), + full_arch: "arm", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "eabi", + unversioned_llvm_target: "arm-unknown-linux-gnueabi", }, ), ( "arm-unknown-linux-musleabihf", TargetInfo { - full_arch: Cow::Borrowed("arm"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("arm-unknown-linux-gnueabihf"), + full_arch: "arm", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "eabihf", + unversioned_llvm_target: "arm-unknown-linux-gnueabihf", }, ), ( "arm64_32-apple-watchos", TargetInfo { - full_arch: Cow::Borrowed("arm64_32"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("watchos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64_32-apple-watchos"), + full_arch: "arm64_32", + arch: "aarch64", + vendor: "apple", + os: "watchos", + env: "", + abi: "", + unversioned_llvm_target: "arm64_32-apple-watchos", }, ), ( "arm64e-apple-darwin", TargetInfo { - full_arch: Cow::Borrowed("arm64e"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("macos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64e-apple-macosx"), + full_arch: "arm64e", + arch: "aarch64", + vendor: "apple", + os: "macos", + env: "", + abi: "", + unversioned_llvm_target: "arm64e-apple-macosx", }, ), ( "arm64e-apple-ios", TargetInfo { - full_arch: Cow::Borrowed("arm64e"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64e-apple-ios"), + full_arch: "arm64e", + arch: "aarch64", + vendor: "apple", + os: "ios", + env: "", + abi: "", + unversioned_llvm_target: "arm64e-apple-ios", }, ), ( "arm64e-apple-tvos", TargetInfo { - full_arch: Cow::Borrowed("arm64e"), - arch: Cow::Borrowed("aarch64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("tvos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64e-apple-tvos"), + full_arch: "arm64e", + arch: "aarch64", + vendor: "apple", + os: "tvos", + env: "", + abi: "", + unversioned_llvm_target: "arm64e-apple-tvos", }, ), ( "arm64ec-pc-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("arm64ec"), - arch: Cow::Borrowed("arm64ec"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("arm64ec-pc-windows-msvc"), + full_arch: "arm64ec", + arch: "arm64ec", + vendor: "pc", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "arm64ec-pc-windows-msvc", }, ), ( "armeb-unknown-linux-gnueabi", TargetInfo { - full_arch: Cow::Borrowed("armeb"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armeb-unknown-linux-gnueabi"), + full_arch: "armeb", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabi", + unversioned_llvm_target: "armeb-unknown-linux-gnueabi", }, ), ( "armebv7r-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("armebv7r"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armebv7r-none-eabi"), + full_arch: "armebv7r", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "armebv7r-none-eabi", }, ), ( "armebv7r-none-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armebv7r"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armebv7r-none-eabihf"), + full_arch: "armebv7r", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armebv7r-none-eabihf", }, ), ( "armv4t-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("armv4t"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv4t-none-eabi"), + full_arch: "armv4t", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv4t-none-eabi", }, ), ( "armv4t-unknown-linux-gnueabi", TargetInfo { - full_arch: Cow::Borrowed("armv4t"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv4t-unknown-linux-gnueabi"), + full_arch: "armv4t", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabi", + unversioned_llvm_target: "armv4t-unknown-linux-gnueabi", }, ), ( "armv5te-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("armv5te"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv5te-none-eabi"), + full_arch: "armv5te", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv5te-none-eabi", }, ), ( "armv5te-unknown-linux-gnueabi", TargetInfo { - full_arch: Cow::Borrowed("armv5te"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv5te-unknown-linux-gnueabi"), + full_arch: "armv5te", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabi", + unversioned_llvm_target: "armv5te-unknown-linux-gnueabi", }, ), ( "armv5te-unknown-linux-musleabi", TargetInfo { - full_arch: Cow::Borrowed("armv5te"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv5te-unknown-linux-gnueabi"), + full_arch: "armv5te", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "eabi", + unversioned_llvm_target: "armv5te-unknown-linux-gnueabi", }, ), ( "armv5te-unknown-linux-uclibceabi", TargetInfo { - full_arch: Cow::Borrowed("armv5te"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("uclibc"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv5te-unknown-linux-uclibcgnueabi"), + full_arch: "armv5te", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "uclibc", + abi: "eabi", + unversioned_llvm_target: "armv5te-unknown-linux-uclibcgnueabi", }, ), ( "armv6-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("armv6"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv6-unknown-freebsd-gnueabihf"), + full_arch: "armv6", + arch: "arm", + vendor: "unknown", + os: "freebsd", + env: "gnu", + abi: "eabihf", + unversioned_llvm_target: "armv6-unknown-freebsd-gnueabihf", }, ), ( "armv6-unknown-netbsd-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv6"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv6-unknown-netbsdelf-eabihf"), + full_arch: "armv6", + arch: "arm", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armv6-unknown-netbsdelf-eabihf", }, ), ( "armv6k-nintendo-3ds", TargetInfo { - full_arch: Cow::Borrowed("armv6k"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("nintendo"), - os: Cow::Borrowed("horizon"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv6k-none-eabihf"), + full_arch: "armv6k", + arch: "arm", + vendor: "nintendo", + os: "horizon", + env: "newlib", + abi: "eabihf", + unversioned_llvm_target: "armv6k-none-eabihf", }, ), ( "armv7-apple-ios", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("armv7-apple-ios"), + full_arch: "armv7", + arch: "arm", + vendor: "apple", + os: "ios", + env: "", + abi: "", + unversioned_llvm_target: "armv7-apple-ios", }, ), ( "armv7-linux-androideabi", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-none-linux-android"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "android", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv7-none-linux-android", }, ), ( "armv7-rtems-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("rtems"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-none-eabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "rtems", + env: "newlib", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-none-eabihf", }, ), ( "armv7-sony-vita-newlibeabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("sony"), - os: Cow::Borrowed("vita"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("thumbv7a-vita-eabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "sony", + os: "vita", + env: "newlib", + abi: "eabihf", + unversioned_llvm_target: "thumbv7a-vita-eabihf", }, ), ( "armv7-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-freebsd-gnueabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "freebsd", + env: "gnu", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-freebsd-gnueabihf", }, ), ( "armv7-unknown-linux-gnueabi", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabi"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabi", + unversioned_llvm_target: "armv7-unknown-linux-gnueabi", }, ), ( "armv7-unknown-linux-gnueabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-linux-gnueabihf", }, ), ( "armv7-unknown-linux-musleabi", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabi"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "eabi", + unversioned_llvm_target: "armv7-unknown-linux-gnueabi", }, ), ( "armv7-unknown-linux-musleabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-linux-gnueabihf", }, ), ( "armv7-unknown-linux-ohos", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("ohos"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-ohos"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "ohos", + abi: "eabi", + unversioned_llvm_target: "armv7-unknown-linux-ohos", }, ), ( "armv7-unknown-linux-uclibceabi", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("uclibc"), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabi"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "uclibc", + abi: "eabi", + unversioned_llvm_target: "armv7-unknown-linux-gnueabi", }, ), ( "armv7-unknown-linux-uclibceabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("uclibc"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "uclibc", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-linux-gnueabihf", }, ), ( "armv7-unknown-netbsd-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-netbsdelf-eabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-netbsdelf-eabihf", }, ), ( "armv7-unknown-trusty", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("trusty"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-unknown-gnueabi"), + full_arch: "armv7", + arch: "arm", + vendor: "unknown", + os: "trusty", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv7-unknown-unknown-gnueabi", }, ), ( "armv7-wrs-vxworks-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabihf"), + full_arch: "armv7", + arch: "arm", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-linux-gnueabihf", }, ), ( "armv7a-kmc-solid_asp3-eabi", TargetInfo { - full_arch: Cow::Borrowed("armv7a"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("kmc"), - os: Cow::Borrowed("solid_asp3"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7a-none-eabi"), + full_arch: "armv7a", + arch: "arm", + vendor: "kmc", + os: "solid_asp3", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv7a-none-eabi", }, ), ( "armv7a-kmc-solid_asp3-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7a"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("kmc"), - os: Cow::Borrowed("solid_asp3"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7a-none-eabihf"), + full_arch: "armv7a", + arch: "arm", + vendor: "kmc", + os: "solid_asp3", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armv7a-none-eabihf", }, ), ( "armv7a-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("armv7a"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7a-none-eabi"), + full_arch: "armv7a", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv7a-none-eabi", }, ), ( "armv7a-none-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7a"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7a-none-eabihf"), + full_arch: "armv7a", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armv7a-none-eabihf", }, ), ( "armv7k-apple-watchos", TargetInfo { - full_arch: Cow::Borrowed("armv7k"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("watchos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("armv7k-apple-watchos"), + full_arch: "armv7k", + arch: "arm", + vendor: "apple", + os: "watchos", + env: "", + abi: "", + unversioned_llvm_target: "armv7k-apple-watchos", }, ), ( "armv7r-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("armv7r"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7r-none-eabi"), + full_arch: "armv7r", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv7r-none-eabi", }, ), ( "armv7r-none-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv7r"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7r-none-eabihf"), + full_arch: "armv7r", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armv7r-none-eabihf", }, ), ( "armv7s-apple-ios", TargetInfo { - full_arch: Cow::Borrowed("armv7s"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("armv7s-apple-ios"), + full_arch: "armv7s", + arch: "arm", + vendor: "apple", + os: "ios", + env: "", + abi: "", + unversioned_llvm_target: "armv7s-apple-ios", }, ), ( "armv8r-none-eabihf", TargetInfo { - full_arch: Cow::Borrowed("armv8r"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv8r-none-eabihf"), + full_arch: "armv8r", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabihf", + unversioned_llvm_target: "armv8r-none-eabihf", }, ), ( "asmjs-unknown-emscripten", TargetInfo { - full_arch: Cow::Borrowed("asmjs"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("emscripten"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-unknown-emscripten"), + full_arch: "asmjs", + arch: "wasm32", + vendor: "unknown", + os: "emscripten", + env: "", + abi: "", + unversioned_llvm_target: "wasm32-unknown-emscripten", }, ), ( "avr-unknown-gnu-atmega328", TargetInfo { - full_arch: Cow::Borrowed("avr"), - arch: Cow::Borrowed("avr"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("avr-unknown-unknown"), + full_arch: "avr", + arch: "avr", + vendor: "unknown", + os: "none", + env: "gnu", + abi: "", + unversioned_llvm_target: "avr-unknown-unknown", }, ), ( "bpfeb-unknown-none", TargetInfo { - full_arch: Cow::Borrowed("bpfeb"), - arch: Cow::Borrowed("bpf"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("bpfeb"), + full_arch: "bpfeb", + arch: "bpf", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "bpfeb", }, ), ( "bpfel-unknown-none", TargetInfo { - full_arch: Cow::Borrowed("bpfel"), - arch: Cow::Borrowed("bpf"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("bpfel"), + full_arch: "bpfel", + arch: "bpf", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "bpfel", }, ), ( "csky-unknown-linux-gnuabiv2", TargetInfo { - full_arch: Cow::Borrowed("csky"), - arch: Cow::Borrowed("csky"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("abiv2"), - unversioned_llvm_target: Cow::Borrowed("csky-unknown-linux-gnuabiv2"), + full_arch: "csky", + arch: "csky", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "abiv2", + unversioned_llvm_target: "csky-unknown-linux-gnuabiv2", }, ), ( "csky-unknown-linux-gnuabiv2hf", TargetInfo { - full_arch: Cow::Borrowed("csky"), - arch: Cow::Borrowed("csky"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("abiv2hf"), - unversioned_llvm_target: Cow::Borrowed("csky-unknown-linux-gnuabiv2"), + full_arch: "csky", + arch: "csky", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "abiv2hf", + unversioned_llvm_target: "csky-unknown-linux-gnuabiv2", }, ), ( "hexagon-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("hexagon"), - arch: Cow::Borrowed("hexagon"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("hexagon-unknown-linux-musl"), + full_arch: "hexagon", + arch: "hexagon", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "hexagon-unknown-linux-musl", }, ), ( "hexagon-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("hexagon"), - arch: Cow::Borrowed("hexagon"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("hexagon-unknown-none-elf"), + full_arch: "hexagon", + arch: "hexagon", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "hexagon-unknown-none-elf", }, ), ( "i386-apple-ios", TargetInfo { - full_arch: Cow::Borrowed("i386"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("i386-apple-ios-simulator"), + full_arch: "i386", + arch: "x86", + vendor: "apple", + os: "ios", + env: "", + abi: "sim", + unversioned_llvm_target: "i386-apple-ios-simulator", }, ), ( "i586-pc-nto-qnx700", TargetInfo { - full_arch: Cow::Borrowed("i586"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("nto"), - env: Cow::Borrowed("nto70"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i586-pc-unknown"), + full_arch: "i586", + arch: "x86", + vendor: "pc", + os: "nto", + env: "nto70", + abi: "", + unversioned_llvm_target: "i586-pc-unknown", }, ), ( "i586-pc-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("i586"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i586-pc-windows-msvc"), + full_arch: "i586", + arch: "x86", + vendor: "pc", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "i586-pc-windows-msvc", }, ), ( "i586-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("i586"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i586-unknown-linux-gnu"), + full_arch: "i586", + arch: "x86", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "i586-unknown-linux-gnu", }, ), ( "i586-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("i586"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i586-unknown-linux-musl"), + full_arch: "i586", + arch: "x86", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "i586-unknown-linux-musl", }, ), ( "i586-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("i586"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i586-unknown-netbsdelf"), + full_arch: "i586", + arch: "x86", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "i586-unknown-netbsdelf", }, ), ( "i686-apple-darwin", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("macos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-apple-macosx"), + full_arch: "i686", + arch: "x86", + vendor: "apple", + os: "macos", + env: "", + abi: "", + unversioned_llvm_target: "i686-apple-macosx", }, ), ( "i686-linux-android", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-linux-android"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "android", + env: "", + abi: "", + unversioned_llvm_target: "i686-linux-android", }, ), ( "i686-pc-windows-gnu", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-pc-windows-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "pc", + os: "windows", + env: "gnu", + abi: "", + unversioned_llvm_target: "i686-pc-windows-gnu", }, ), ( "i686-pc-windows-gnullvm", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("llvm"), - unversioned_llvm_target: Cow::Borrowed("i686-pc-windows-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "pc", + os: "windows", + env: "gnu", + abi: "llvm", + unversioned_llvm_target: "i686-pc-windows-gnu", }, ), ( "i686-pc-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-pc-windows-msvc"), + full_arch: "i686", + arch: "x86", + vendor: "pc", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "i686-pc-windows-msvc", }, ), ( "i686-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-freebsd"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "i686-unknown-freebsd", }, ), ( "i686-unknown-haiku", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("haiku"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-haiku"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "haiku", + env: "", + abi: "", + unversioned_llvm_target: "i686-unknown-haiku", }, ), ( "i686-unknown-hurd-gnu", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("hurd"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-hurd-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "hurd", + env: "gnu", + abi: "", + unversioned_llvm_target: "i686-unknown-hurd-gnu", }, ), ( "i686-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-linux-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "i686-unknown-linux-gnu", }, ), ( "i686-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-linux-musl"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "i686-unknown-linux-musl", }, ), ( "i686-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-netbsdelf"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "i686-unknown-netbsdelf", }, ), ( "i686-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-openbsd"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "i686-unknown-openbsd", }, ), ( "i686-unknown-redox", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("redox"), - env: Cow::Borrowed("relibc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-redox"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "redox", + env: "relibc", + abi: "", + unversioned_llvm_target: "i686-unknown-redox", }, ), ( "i686-unknown-uefi", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("uefi"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-windows-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "unknown", + os: "uefi", + env: "", + abi: "", + unversioned_llvm_target: "i686-unknown-windows-gnu", }, ), ( "i686-uwp-windows-gnu", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("uwp"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("uwp"), - unversioned_llvm_target: Cow::Borrowed("i686-pc-windows-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "uwp", + os: "windows", + env: "gnu", + abi: "uwp", + unversioned_llvm_target: "i686-pc-windows-gnu", }, ), ( "i686-uwp-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("uwp"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed("uwp"), - unversioned_llvm_target: Cow::Borrowed("i686-pc-windows-msvc"), + full_arch: "i686", + arch: "x86", + vendor: "uwp", + os: "windows", + env: "msvc", + abi: "uwp", + unversioned_llvm_target: "i686-pc-windows-msvc", }, ), ( "i686-win7-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("win7"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-pc-windows-msvc"), + full_arch: "i686", + arch: "x86", + vendor: "win7", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "i686-pc-windows-msvc", }, ), ( "i686-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("i686"), - arch: Cow::Borrowed("x86"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("i686-unknown-linux-gnu"), + full_arch: "i686", + arch: "x86", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "i686-unknown-linux-gnu", }, ), ( "loongarch64-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("loongarch64"), - arch: Cow::Borrowed("loongarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("loongarch64-unknown-linux-gnu"), + full_arch: "loongarch64", + arch: "loongarch64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "loongarch64-unknown-linux-gnu", }, ), ( "loongarch64-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("loongarch64"), - arch: Cow::Borrowed("loongarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("loongarch64-unknown-linux-musl"), + full_arch: "loongarch64", + arch: "loongarch64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "loongarch64-unknown-linux-musl", }, ), ( "loongarch64-unknown-linux-ohos", TargetInfo { - full_arch: Cow::Borrowed("loongarch64"), - arch: Cow::Borrowed("loongarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("ohos"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("loongarch64-unknown-linux-ohos"), + full_arch: "loongarch64", + arch: "loongarch64", + vendor: "unknown", + os: "linux", + env: "ohos", + abi: "", + unversioned_llvm_target: "loongarch64-unknown-linux-ohos", }, ), ( "loongarch64-unknown-none", TargetInfo { - full_arch: Cow::Borrowed("loongarch64"), - arch: Cow::Borrowed("loongarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("loongarch64-unknown-none"), + full_arch: "loongarch64", + arch: "loongarch64", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "loongarch64-unknown-none", }, ), ( "loongarch64-unknown-none-softfloat", TargetInfo { - full_arch: Cow::Borrowed("loongarch64"), - arch: Cow::Borrowed("loongarch64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("softfloat"), - unversioned_llvm_target: Cow::Borrowed("loongarch64-unknown-none"), + full_arch: "loongarch64", + arch: "loongarch64", + vendor: "unknown", + os: "none", + env: "", + abi: "softfloat", + unversioned_llvm_target: "loongarch64-unknown-none", }, ), ( "m68k-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("m68k"), - arch: Cow::Borrowed("m68k"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("m68k-unknown-linux-gnu"), + full_arch: "m68k", + arch: "m68k", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "m68k-unknown-linux-gnu", }, ), ( "mips-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("mips"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mips-unknown-linux-gnu"), + full_arch: "mips", + arch: "mips", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "mips-unknown-linux-gnu", }, ), ( "mips-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("mips"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mips-unknown-linux-musl"), + full_arch: "mips", + arch: "mips", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "mips-unknown-linux-musl", }, ), ( "mips-unknown-linux-uclibc", TargetInfo { - full_arch: Cow::Borrowed("mips"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("uclibc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mips-unknown-linux-uclibc"), + full_arch: "mips", + arch: "mips", + vendor: "unknown", + os: "linux", + env: "uclibc", + abi: "", + unversioned_llvm_target: "mips-unknown-linux-uclibc", }, ), ( "mips64-openwrt-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("mips64"), - arch: Cow::Borrowed("mips64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mips64-unknown-linux-musl"), + full_arch: "mips64", + arch: "mips64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "abi64", + unversioned_llvm_target: "mips64-unknown-linux-musl", }, ), ( "mips64-unknown-linux-gnuabi64", TargetInfo { - full_arch: Cow::Borrowed("mips64"), - arch: Cow::Borrowed("mips64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mips64-unknown-linux-gnuabi64"), + full_arch: "mips64", + arch: "mips64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "abi64", + unversioned_llvm_target: "mips64-unknown-linux-gnuabi64", }, ), ( "mips64-unknown-linux-muslabi64", TargetInfo { - full_arch: Cow::Borrowed("mips64"), - arch: Cow::Borrowed("mips64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mips64-unknown-linux-musl"), + full_arch: "mips64", + arch: "mips64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "abi64", + unversioned_llvm_target: "mips64-unknown-linux-musl", }, ), ( "mips64el-unknown-linux-gnuabi64", TargetInfo { - full_arch: Cow::Borrowed("mips64el"), - arch: Cow::Borrowed("mips64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mips64el-unknown-linux-gnuabi64"), + full_arch: "mips64el", + arch: "mips64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "abi64", + unversioned_llvm_target: "mips64el-unknown-linux-gnuabi64", }, ), ( "mips64el-unknown-linux-muslabi64", TargetInfo { - full_arch: Cow::Borrowed("mips64el"), - arch: Cow::Borrowed("mips64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mips64el-unknown-linux-musl"), + full_arch: "mips64el", + arch: "mips64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "abi64", + unversioned_llvm_target: "mips64el-unknown-linux-musl", }, ), ( "mipsel-sony-psp", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("sony"), - os: Cow::Borrowed("psp"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-sony-psp"), + full_arch: "mipsel", + arch: "mips", + vendor: "sony", + os: "psp", + env: "", + abi: "", + unversioned_llvm_target: "mipsel-sony-psp", }, ), ( "mipsel-sony-psx", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("sony"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed("psx"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-sony-psx"), + full_arch: "mipsel", + arch: "mips", + vendor: "sony", + os: "none", + env: "psx", + abi: "", + unversioned_llvm_target: "mipsel-sony-psx", }, ), ( "mipsel-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-unknown-linux-gnu"), + full_arch: "mipsel", + arch: "mips", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "mipsel-unknown-linux-gnu", }, ), ( "mipsel-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-unknown-linux-musl"), + full_arch: "mipsel", + arch: "mips", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "mipsel-unknown-linux-musl", }, ), ( "mipsel-unknown-linux-uclibc", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("uclibc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-unknown-linux-uclibc"), + full_arch: "mipsel", + arch: "mips", + vendor: "unknown", + os: "linux", + env: "uclibc", + abi: "", + unversioned_llvm_target: "mipsel-unknown-linux-uclibc", }, ), ( "mipsel-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-unknown-netbsd"), + full_arch: "mipsel", + arch: "mips", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "mipsel-unknown-netbsd", }, ), ( "mipsel-unknown-none", TargetInfo { - full_arch: Cow::Borrowed("mipsel"), - arch: Cow::Borrowed("mips"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsel-unknown-none"), + full_arch: "mipsel", + arch: "mips", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "mipsel-unknown-none", }, ), ( "mipsisa32r6-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("mipsisa32r6"), - arch: Cow::Borrowed("mips32r6"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsisa32r6-unknown-linux-gnu"), + full_arch: "mipsisa32r6", + arch: "mips32r6", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "mipsisa32r6-unknown-linux-gnu", }, ), ( "mipsisa32r6el-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("mipsisa32r6el"), - arch: Cow::Borrowed("mips32r6"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("mipsisa32r6el-unknown-linux-gnu"), + full_arch: "mipsisa32r6el", + arch: "mips32r6", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "mipsisa32r6el-unknown-linux-gnu", }, ), ( "mipsisa64r6-unknown-linux-gnuabi64", TargetInfo { - full_arch: Cow::Borrowed("mipsisa64r6"), - arch: Cow::Borrowed("mips64r6"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mipsisa64r6-unknown-linux-gnuabi64"), + full_arch: "mipsisa64r6", + arch: "mips64r6", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "abi64", + unversioned_llvm_target: "mipsisa64r6-unknown-linux-gnuabi64", }, ), ( "mipsisa64r6el-unknown-linux-gnuabi64", TargetInfo { - full_arch: Cow::Borrowed("mipsisa64r6el"), - arch: Cow::Borrowed("mips64r6"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("abi64"), - unversioned_llvm_target: Cow::Borrowed("mipsisa64r6el-unknown-linux-gnuabi64"), + full_arch: "mipsisa64r6el", + arch: "mips64r6", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "abi64", + unversioned_llvm_target: "mipsisa64r6el-unknown-linux-gnuabi64", }, ), ( "msp430-none-elf", TargetInfo { - full_arch: Cow::Borrowed("msp430"), - arch: Cow::Borrowed("msp430"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("msp430-none-elf"), + full_arch: "msp430", + arch: "msp430", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "msp430-none-elf", }, ), ( "nvptx64-nvidia-cuda", TargetInfo { - full_arch: Cow::Borrowed("nvptx64"), - arch: Cow::Borrowed("nvptx64"), - vendor: Cow::Borrowed("nvidia"), - os: Cow::Borrowed("cuda"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("nvptx64-nvidia-cuda"), + full_arch: "nvptx64", + arch: "nvptx64", + vendor: "nvidia", + os: "cuda", + env: "", + abi: "", + unversioned_llvm_target: "nvptx64-nvidia-cuda", }, ), ( "powerpc-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-freebsd13.0"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "powerpc-unknown-freebsd13.0", }, ), ( "powerpc-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-linux-gnu"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "powerpc-unknown-linux-gnu", }, ), ( "powerpc-unknown-linux-gnuspe", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("spe"), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-linux-gnuspe"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "spe", + unversioned_llvm_target: "powerpc-unknown-linux-gnuspe", }, ), ( "powerpc-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-linux-musl"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "powerpc-unknown-linux-musl", }, ), ( "powerpc-unknown-linux-muslspe", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("spe"), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-linux-muslspe"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "spe", + unversioned_llvm_target: "powerpc-unknown-linux-muslspe", }, ), ( "powerpc-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-netbsd"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "powerpc-unknown-netbsd", }, ), ( "powerpc-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-openbsd"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "powerpc-unknown-openbsd", }, ), ( "powerpc-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-linux-gnu"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "powerpc-unknown-linux-gnu", }, ), ( "powerpc-wrs-vxworks-spe", TargetInfo { - full_arch: Cow::Borrowed("powerpc"), - arch: Cow::Borrowed("powerpc"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("spe"), - unversioned_llvm_target: Cow::Borrowed("powerpc-unknown-linux-gnuspe"), + full_arch: "powerpc", + arch: "powerpc", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "spe", + unversioned_llvm_target: "powerpc-unknown-linux-gnuspe", }, ), ( "powerpc64-ibm-aix", TargetInfo { - full_arch: Cow::Borrowed("powerpc64"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("ibm"), - os: Cow::Borrowed("aix"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("vec-extabi"), - unversioned_llvm_target: Cow::Borrowed("powerpc64-ibm-aix"), + full_arch: "powerpc64", + arch: "powerpc64", + vendor: "ibm", + os: "aix", + env: "", + abi: "vec-extabi", + unversioned_llvm_target: "powerpc64-ibm-aix", }, ), ( "powerpc64-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("powerpc64"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64-unknown-freebsd"), + full_arch: "powerpc64", + arch: "powerpc64", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "powerpc64-unknown-freebsd", }, ), ( "powerpc64-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("powerpc64"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64-unknown-linux-gnu"), + full_arch: "powerpc64", + arch: "powerpc64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "powerpc64-unknown-linux-gnu", }, ), ( "powerpc64-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("powerpc64"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64-unknown-linux-musl"), + full_arch: "powerpc64", + arch: "powerpc64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "powerpc64-unknown-linux-musl", }, ), ( "powerpc64-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("powerpc64"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64-unknown-openbsd"), + full_arch: "powerpc64", + arch: "powerpc64", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "powerpc64-unknown-openbsd", }, ), ( "powerpc64-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("powerpc64"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64-unknown-linux-gnu"), + full_arch: "powerpc64", + arch: "powerpc64", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "powerpc64-unknown-linux-gnu", }, ), ( "powerpc64le-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("powerpc64le"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64le-unknown-freebsd"), + full_arch: "powerpc64le", + arch: "powerpc64", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "powerpc64le-unknown-freebsd", }, ), ( "powerpc64le-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("powerpc64le"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64le-unknown-linux-gnu"), + full_arch: "powerpc64le", + arch: "powerpc64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "powerpc64le-unknown-linux-gnu", }, ), ( "powerpc64le-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("powerpc64le"), - arch: Cow::Borrowed("powerpc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("powerpc64le-unknown-linux-musl"), + full_arch: "powerpc64le", + arch: "powerpc64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "powerpc64le-unknown-linux-musl", }, ), ( "riscv32-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("riscv32"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32", + arch: "riscv32", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32e-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32e"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32e", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32em-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32em"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32em", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32emc-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32emc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32emc", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32gc-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("riscv32gc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32-unknown-linux-gnu"), + full_arch: "riscv32gc", + arch: "riscv32", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "riscv32-unknown-linux-gnu", }, ), ( "riscv32gc-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("riscv32gc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32-unknown-linux-musl"), + full_arch: "riscv32gc", + arch: "riscv32", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "riscv32-unknown-linux-musl", }, ), ( "riscv32i-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32i"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32i", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32im-risc0-zkvm-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32im"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("risc0"), - os: Cow::Borrowed("zkvm"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32im", + arch: "riscv32", + vendor: "risc0", + os: "zkvm", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32im-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32im"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32im", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32ima-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32ima"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32ima", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imac-esp-espidf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imac"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("espidf"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imac", + arch: "riscv32", + vendor: "espressif", + os: "espidf", + env: "newlib", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imac-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imac"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imac", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imac-unknown-nuttx-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imac"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imac", + arch: "riscv32", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imac-unknown-xous-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imac"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("xous"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imac", + arch: "riscv32", + vendor: "unknown", + os: "xous", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imafc-esp-espidf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imafc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("espidf"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imafc", + arch: "riscv32", + vendor: "espressif", + os: "espidf", + env: "newlib", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imafc-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imafc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imafc", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imafc-unknown-nuttx-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imafc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imafc", + arch: "riscv32", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imc-esp-espidf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("espidf"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imc", + arch: "riscv32", + vendor: "espressif", + os: "espidf", + env: "newlib", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imc-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imc", + arch: "riscv32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv32imc-unknown-nuttx-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv32imc"), - arch: Cow::Borrowed("riscv32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv32"), + full_arch: "riscv32imc", + arch: "riscv32", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "", + unversioned_llvm_target: "riscv32", }, ), ( "riscv64-linux-android", TargetInfo { - full_arch: Cow::Borrowed("riscv64"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-linux-android"), + full_arch: "riscv64", + arch: "riscv64", + vendor: "unknown", + os: "android", + env: "", + abi: "", + unversioned_llvm_target: "riscv64-linux-android", }, ), ( "riscv64-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("riscv64"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64"), + full_arch: "riscv64", + arch: "riscv64", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "riscv64", }, ), ( "riscv64gc-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-freebsd"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "riscv64-unknown-freebsd", }, ), ( "riscv64gc-unknown-fuchsia", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("fuchsia"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-fuchsia"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "fuchsia", + env: "", + abi: "", + unversioned_llvm_target: "riscv64-unknown-fuchsia", }, ), ( "riscv64gc-unknown-hermit", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("hermit"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-hermit"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "hermit", + env: "", + abi: "", + unversioned_llvm_target: "riscv64-unknown-hermit", }, ), ( "riscv64gc-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-linux-gnu"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "riscv64-unknown-linux-gnu", }, ), ( "riscv64gc-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-linux-musl"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "riscv64-unknown-linux-musl", }, ), ( "riscv64gc-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-netbsd"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "riscv64-unknown-netbsd", }, ), ( "riscv64gc-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv64", }, ), ( "riscv64gc-unknown-nuttx-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "", + unversioned_llvm_target: "riscv64", }, ), ( "riscv64gc-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("riscv64gc"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64-unknown-openbsd"), + full_arch: "riscv64gc", + arch: "riscv64", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "riscv64-unknown-openbsd", }, ), ( "riscv64imac-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv64imac"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64"), + full_arch: "riscv64imac", + arch: "riscv64", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "riscv64", }, ), ( "riscv64imac-unknown-nuttx-elf", TargetInfo { - full_arch: Cow::Borrowed("riscv64imac"), - arch: Cow::Borrowed("riscv64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("riscv64"), + full_arch: "riscv64imac", + arch: "riscv64", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "", + unversioned_llvm_target: "riscv64", }, ), ( "s390x-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("s390x"), - arch: Cow::Borrowed("s390x"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("s390x-unknown-linux-gnu"), + full_arch: "s390x", + arch: "s390x", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "s390x-unknown-linux-gnu", }, ), ( "s390x-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("s390x"), - arch: Cow::Borrowed("s390x"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("s390x-unknown-linux-musl"), + full_arch: "s390x", + arch: "s390x", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "s390x-unknown-linux-musl", }, ), ( "sparc-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("sparc"), - arch: Cow::Borrowed("sparc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("sparc-unknown-linux-gnu"), + full_arch: "sparc", + arch: "sparc", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "sparc-unknown-linux-gnu", }, ), ( "sparc-unknown-none-elf", TargetInfo { - full_arch: Cow::Borrowed("sparc"), - arch: Cow::Borrowed("sparc"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("sparc-unknown-none-elf"), + full_arch: "sparc", + arch: "sparc", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "sparc-unknown-none-elf", }, ), ( "sparc64-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("sparc64"), - arch: Cow::Borrowed("sparc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("sparc64-unknown-linux-gnu"), + full_arch: "sparc64", + arch: "sparc64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "sparc64-unknown-linux-gnu", }, ), ( "sparc64-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("sparc64"), - arch: Cow::Borrowed("sparc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("sparc64-unknown-netbsd"), + full_arch: "sparc64", + arch: "sparc64", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "sparc64-unknown-netbsd", }, ), ( "sparc64-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("sparc64"), - arch: Cow::Borrowed("sparc64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("sparc64-unknown-openbsd"), + full_arch: "sparc64", + arch: "sparc64", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "sparc64-unknown-openbsd", }, ), ( "sparcv9-sun-solaris", TargetInfo { - full_arch: Cow::Borrowed("sparcv9"), - arch: Cow::Borrowed("sparc64"), - vendor: Cow::Borrowed("sun"), - os: Cow::Borrowed("solaris"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("sparcv9-sun-solaris"), + full_arch: "sparcv9", + arch: "sparc64", + vendor: "sun", + os: "solaris", + env: "", + abi: "", + unversioned_llvm_target: "sparcv9-sun-solaris", }, ), ( "thumbv4t-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv4t"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv4t-none-eabi"), + full_arch: "thumbv4t", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv4t-none-eabi", }, ), ( "thumbv5te-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv5te"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv5te-none-eabi"), + full_arch: "thumbv5te", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv5te-none-eabi", }, ), ( "thumbv6m-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv6m"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv6m-none-eabi"), + full_arch: "thumbv6m", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv6m-none-eabi", }, ), ( "thumbv6m-nuttx-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv6m"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv6m-none-eabi"), + full_arch: "thumbv6m", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv6m-none-eabi", }, ), ( "thumbv7a-pc-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("thumbv7a"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("thumbv7a-pc-windows-msvc"), + full_arch: "thumbv7a", + arch: "arm", + vendor: "pc", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "thumbv7a-pc-windows-msvc", }, ), ( "thumbv7a-uwp-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("thumbv7a"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("uwp"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed("uwp"), - unversioned_llvm_target: Cow::Borrowed("thumbv7a-pc-windows-msvc"), + full_arch: "thumbv7a", + arch: "arm", + vendor: "uwp", + os: "windows", + env: "msvc", + abi: "uwp", + unversioned_llvm_target: "thumbv7a-pc-windows-msvc", }, ), ( "thumbv7em-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv7em"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv7em-none-eabi"), + full_arch: "thumbv7em", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv7em-none-eabi", }, ), ( "thumbv7em-none-eabihf", TargetInfo { - full_arch: Cow::Borrowed("thumbv7em"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("thumbv7em-none-eabihf"), + full_arch: "thumbv7em", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabihf", + unversioned_llvm_target: "thumbv7em-none-eabihf", }, ), ( "thumbv7em-nuttx-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv7em"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv7em-none-eabi"), + full_arch: "thumbv7em", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv7em-none-eabi", }, ), ( "thumbv7em-nuttx-eabihf", TargetInfo { - full_arch: Cow::Borrowed("thumbv7em"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("thumbv7em-none-eabihf"), + full_arch: "thumbv7em", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabihf", + unversioned_llvm_target: "thumbv7em-none-eabihf", }, ), ( "thumbv7m-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv7m"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv7m-none-eabi"), + full_arch: "thumbv7m", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv7m-none-eabi", }, ), ( "thumbv7m-nuttx-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv7m"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv7m-none-eabi"), + full_arch: "thumbv7m", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv7m-none-eabi", }, ), ( "thumbv7neon-linux-androideabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv7neon"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("armv7-none-linux-android"), + full_arch: "thumbv7neon", + arch: "arm", + vendor: "unknown", + os: "android", + env: "", + abi: "eabi", + unversioned_llvm_target: "armv7-none-linux-android", }, ), ( "thumbv7neon-unknown-linux-gnueabihf", TargetInfo { - full_arch: Cow::Borrowed("thumbv7neon"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabihf"), + full_arch: "thumbv7neon", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-linux-gnueabihf", }, ), ( "thumbv7neon-unknown-linux-musleabihf", TargetInfo { - full_arch: Cow::Borrowed("thumbv7neon"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("armv7-unknown-linux-gnueabihf"), + full_arch: "thumbv7neon", + arch: "arm", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "eabihf", + unversioned_llvm_target: "armv7-unknown-linux-gnueabihf", }, ), ( "thumbv8m.base-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv8m.base"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv8m.base-none-eabi"), + full_arch: "thumbv8m.base", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv8m.base-none-eabi", }, ), ( "thumbv8m.base-nuttx-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv8m.base"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv8m.base-none-eabi"), + full_arch: "thumbv8m.base", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv8m.base-none-eabi", }, ), ( "thumbv8m.main-none-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv8m.main"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv8m.main-none-eabi"), + full_arch: "thumbv8m.main", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv8m.main-none-eabi", }, ), ( "thumbv8m.main-none-eabihf", TargetInfo { - full_arch: Cow::Borrowed("thumbv8m.main"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("thumbv8m.main-none-eabihf"), + full_arch: "thumbv8m.main", + arch: "arm", + vendor: "unknown", + os: "none", + env: "", + abi: "eabihf", + unversioned_llvm_target: "thumbv8m.main-none-eabihf", }, ), ( "thumbv8m.main-nuttx-eabi", TargetInfo { - full_arch: Cow::Borrowed("thumbv8m.main"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabi"), - unversioned_llvm_target: Cow::Borrowed("thumbv8m.main-none-eabi"), + full_arch: "thumbv8m.main", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabi", + unversioned_llvm_target: "thumbv8m.main-none-eabi", }, ), ( "thumbv8m.main-nuttx-eabihf", TargetInfo { - full_arch: Cow::Borrowed("thumbv8m.main"), - arch: Cow::Borrowed("arm"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("nuttx"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("eabihf"), - unversioned_llvm_target: Cow::Borrowed("thumbv8m.main-none-eabihf"), + full_arch: "thumbv8m.main", + arch: "arm", + vendor: "unknown", + os: "nuttx", + env: "", + abi: "eabihf", + unversioned_llvm_target: "thumbv8m.main-none-eabihf", }, ), ( "wasm32-unknown-emscripten", TargetInfo { - full_arch: Cow::Borrowed("wasm32"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("emscripten"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-unknown-emscripten"), + full_arch: "wasm32", + arch: "wasm32", + vendor: "unknown", + os: "emscripten", + env: "", + abi: "", + unversioned_llvm_target: "wasm32-unknown-emscripten", }, ), ( "wasm32-unknown-unknown", TargetInfo { - full_arch: Cow::Borrowed("wasm32"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("unknown"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-unknown-unknown"), + full_arch: "wasm32", + arch: "wasm32", + vendor: "unknown", + os: "unknown", + env: "", + abi: "", + unversioned_llvm_target: "wasm32-unknown-unknown", }, ), ( "wasm32-wasi", TargetInfo { - full_arch: Cow::Borrowed("wasm32"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("wasi"), - env: Cow::Borrowed("p1"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-wasi"), + full_arch: "wasm32", + arch: "wasm32", + vendor: "unknown", + os: "wasi", + env: "p1", + abi: "", + unversioned_llvm_target: "wasm32-wasi", }, ), ( "wasm32-wasip1", TargetInfo { - full_arch: Cow::Borrowed("wasm32"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("wasi"), - env: Cow::Borrowed("p1"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-wasi"), + full_arch: "wasm32", + arch: "wasm32", + vendor: "unknown", + os: "wasi", + env: "p1", + abi: "", + unversioned_llvm_target: "wasm32-wasi", }, ), ( "wasm32-wasip1-threads", TargetInfo { - full_arch: Cow::Borrowed("wasm32"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("wasi"), - env: Cow::Borrowed("p1"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-wasi"), + full_arch: "wasm32", + arch: "wasm32", + vendor: "unknown", + os: "wasi", + env: "p1", + abi: "", + unversioned_llvm_target: "wasm32-wasi", }, ), ( "wasm32-wasip2", TargetInfo { - full_arch: Cow::Borrowed("wasm32"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("wasi"), - env: Cow::Borrowed("p2"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-wasip2"), + full_arch: "wasm32", + arch: "wasm32", + vendor: "unknown", + os: "wasi", + env: "p2", + abi: "", + unversioned_llvm_target: "wasm32-wasip2", }, ), ( "wasm32v1-none", TargetInfo { - full_arch: Cow::Borrowed("wasm32v1"), - arch: Cow::Borrowed("wasm32"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm32-unknown-unknown"), + full_arch: "wasm32v1", + arch: "wasm32", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "wasm32-unknown-unknown", }, ), ( "wasm64-unknown-unknown", TargetInfo { - full_arch: Cow::Borrowed("wasm64"), - arch: Cow::Borrowed("wasm64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("unknown"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("wasm64-unknown-unknown"), + full_arch: "wasm64", + arch: "wasm64", + vendor: "unknown", + os: "unknown", + env: "", + abi: "", + unversioned_llvm_target: "wasm64-unknown-unknown", }, ), ( "x86_64-apple-darwin", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("macos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-apple-macosx"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "apple", + os: "macos", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-apple-macosx", }, ), ( "x86_64-apple-ios", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("x86_64-apple-ios-simulator"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "apple", + os: "ios", + env: "", + abi: "sim", + unversioned_llvm_target: "x86_64-apple-ios-simulator", }, ), ( "x86_64-apple-ios-macabi", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("ios"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("macabi"), - unversioned_llvm_target: Cow::Borrowed("x86_64-apple-ios-macabi"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "apple", + os: "ios", + env: "", + abi: "macabi", + unversioned_llvm_target: "x86_64-apple-ios-macabi", }, ), ( "x86_64-apple-tvos", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("tvos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("x86_64-apple-tvos-simulator"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "apple", + os: "tvos", + env: "", + abi: "sim", + unversioned_llvm_target: "x86_64-apple-tvos-simulator", }, ), ( "x86_64-apple-watchos-sim", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("watchos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed("sim"), - unversioned_llvm_target: Cow::Borrowed("x86_64-apple-watchos-simulator"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "apple", + os: "watchos", + env: "", + abi: "sim", + unversioned_llvm_target: "x86_64-apple-watchos-simulator", }, ), ( "x86_64-fortanix-unknown-sgx", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("fortanix"), - os: Cow::Borrowed("unknown"), - env: Cow::Borrowed("sgx"), - abi: Cow::Borrowed("fortanix"), - unversioned_llvm_target: Cow::Borrowed("x86_64-elf"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "fortanix", + os: "unknown", + env: "sgx", + abi: "fortanix", + unversioned_llvm_target: "x86_64-elf", }, ), ( "x86_64-fuchsia", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("fuchsia"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-fuchsia"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "fuchsia", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-fuchsia", }, ), ( "x86_64-linux-android", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("android"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-linux-android"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "android", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-linux-android", }, ), ( "x86_64-pc-nto-qnx710", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("nto"), - env: Cow::Borrowed("nto71"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-unknown"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "pc", + os: "nto", + env: "nto71", + abi: "", + unversioned_llvm_target: "x86_64-pc-unknown", }, ), ( "x86_64-pc-solaris", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("solaris"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-solaris"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "pc", + os: "solaris", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-pc-solaris", }, ), ( "x86_64-pc-windows-gnu", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-windows-gnu"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "pc", + os: "windows", + env: "gnu", + abi: "", + unversioned_llvm_target: "x86_64-pc-windows-gnu", }, ), ( "x86_64-pc-windows-gnullvm", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("llvm"), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-windows-gnu"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "pc", + os: "windows", + env: "gnu", + abi: "llvm", + unversioned_llvm_target: "x86_64-pc-windows-gnu", }, ), ( "x86_64-pc-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("pc"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-windows-msvc"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "pc", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "x86_64-pc-windows-msvc", }, ), ( "x86_64-sun-solaris", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("sun"), - os: Cow::Borrowed("solaris"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-solaris"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "sun", + os: "solaris", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-pc-solaris", }, ), ( "x86_64-unikraft-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unikraft"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-musl"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unikraft", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "x86_64-unknown-linux-musl", }, ), ( "x86_64-unknown-dragonfly", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("dragonfly"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-dragonfly"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "dragonfly", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-dragonfly", }, ), ( "x86_64-unknown-freebsd", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("freebsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-freebsd"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "freebsd", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-freebsd", }, ), ( "x86_64-unknown-fuchsia", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("fuchsia"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-fuchsia"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "fuchsia", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-fuchsia", }, ), ( "x86_64-unknown-haiku", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("haiku"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-haiku"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "haiku", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-haiku", }, ), ( "x86_64-unknown-hermit", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("hermit"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-hermit"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "hermit", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-hermit", }, ), ( "x86_64-unknown-hurd-gnu", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("hurd"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-hurd-gnu"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "hurd", + env: "gnu", + abi: "", + unversioned_llvm_target: "x86_64-unknown-hurd-gnu", }, ), ( "x86_64-unknown-illumos", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("illumos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-solaris"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "illumos", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-pc-solaris", }, ), ( "x86_64-unknown-l4re-uclibc", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("l4re"), - env: Cow::Borrowed("uclibc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-l4re-uclibc"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "l4re", + env: "uclibc", + abi: "", + unversioned_llvm_target: "x86_64-unknown-l4re-uclibc", }, ), ( "x86_64-unknown-linux-gnu", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-gnu"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "", + unversioned_llvm_target: "x86_64-unknown-linux-gnu", }, ), ( "x86_64-unknown-linux-gnux32", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("x32"), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-gnux32"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "linux", + env: "gnu", + abi: "x32", + unversioned_llvm_target: "x86_64-unknown-linux-gnux32", }, ), ( "x86_64-unknown-linux-musl", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("musl"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-musl"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "linux", + env: "musl", + abi: "", + unversioned_llvm_target: "x86_64-unknown-linux-musl", }, ), ( "x86_64-unknown-linux-none", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-none"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "linux", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-linux-none", }, ), ( "x86_64-unknown-linux-ohos", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("linux"), - env: Cow::Borrowed("ohos"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-ohos"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "linux", + env: "ohos", + abi: "", + unversioned_llvm_target: "x86_64-unknown-linux-ohos", }, ), ( "x86_64-unknown-netbsd", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("netbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-netbsd"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "netbsd", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-netbsd", }, ), ( "x86_64-unknown-none", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-none-elf"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-none-elf", }, ), ( "x86_64-unknown-none-linuxkernel", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-none-elf"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "none", + env: "gnu", + abi: "", + unversioned_llvm_target: "x86_64-unknown-none-elf", }, ), ( "x86_64-unknown-openbsd", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("openbsd"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-openbsd"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "openbsd", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-openbsd", }, ), ( "x86_64-unknown-redox", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("redox"), - env: Cow::Borrowed("relibc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-redox"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "redox", + env: "relibc", + abi: "", + unversioned_llvm_target: "x86_64-unknown-redox", }, ), ( "x86_64-unknown-trusty", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("trusty"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-unknown-musl"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "trusty", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-unknown-musl", }, ), ( "x86_64-unknown-uefi", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("unknown"), - os: Cow::Borrowed("uefi"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-windows"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "unknown", + os: "uefi", + env: "", + abi: "", + unversioned_llvm_target: "x86_64-unknown-windows", }, ), ( "x86_64-uwp-windows-gnu", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("uwp"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed("uwp"), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-windows-gnu"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "uwp", + os: "windows", + env: "gnu", + abi: "uwp", + unversioned_llvm_target: "x86_64-pc-windows-gnu", }, ), ( "x86_64-uwp-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("uwp"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed("uwp"), - unversioned_llvm_target: Cow::Borrowed("x86_64-pc-windows-msvc"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "uwp", + os: "windows", + env: "msvc", + abi: "uwp", + unversioned_llvm_target: "x86_64-pc-windows-msvc", }, ), ( "x86_64-win7-windows-msvc", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("win7"), - os: Cow::Borrowed("windows"), - env: Cow::Borrowed("msvc"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-win7-windows-msvc"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "win7", + os: "windows", + env: "msvc", + abi: "", + unversioned_llvm_target: "x86_64-win7-windows-msvc", }, ), ( "x86_64-wrs-vxworks", TargetInfo { - full_arch: Cow::Borrowed("x86_64"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("wrs"), - os: Cow::Borrowed("vxworks"), - env: Cow::Borrowed("gnu"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64-unknown-linux-gnu"), + full_arch: "x86_64", + arch: "x86_64", + vendor: "wrs", + os: "vxworks", + env: "gnu", + abi: "", + unversioned_llvm_target: "x86_64-unknown-linux-gnu", }, ), ( "x86_64h-apple-darwin", TargetInfo { - full_arch: Cow::Borrowed("x86_64h"), - arch: Cow::Borrowed("x86_64"), - vendor: Cow::Borrowed("apple"), - os: Cow::Borrowed("macos"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("x86_64h-apple-macosx"), + full_arch: "x86_64h", + arch: "x86_64", + vendor: "apple", + os: "macos", + env: "", + abi: "", + unversioned_llvm_target: "x86_64h-apple-macosx", }, ), ( "xtensa-esp32-espidf", TargetInfo { - full_arch: Cow::Borrowed("xtensa"), - arch: Cow::Borrowed("xtensa"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("espidf"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("xtensa-none-elf"), + full_arch: "xtensa", + arch: "xtensa", + vendor: "espressif", + os: "espidf", + env: "newlib", + abi: "", + unversioned_llvm_target: "xtensa-none-elf", }, ), ( "xtensa-esp32-none-elf", TargetInfo { - full_arch: Cow::Borrowed("xtensa"), - arch: Cow::Borrowed("xtensa"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("xtensa-none-elf"), + full_arch: "xtensa", + arch: "xtensa", + vendor: "espressif", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "xtensa-none-elf", }, ), ( "xtensa-esp32s2-espidf", TargetInfo { - full_arch: Cow::Borrowed("xtensa"), - arch: Cow::Borrowed("xtensa"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("espidf"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("xtensa-none-elf"), + full_arch: "xtensa", + arch: "xtensa", + vendor: "espressif", + os: "espidf", + env: "newlib", + abi: "", + unversioned_llvm_target: "xtensa-none-elf", }, ), ( "xtensa-esp32s2-none-elf", TargetInfo { - full_arch: Cow::Borrowed("xtensa"), - arch: Cow::Borrowed("xtensa"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("xtensa-none-elf"), + full_arch: "xtensa", + arch: "xtensa", + vendor: "espressif", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "xtensa-none-elf", }, ), ( "xtensa-esp32s3-espidf", TargetInfo { - full_arch: Cow::Borrowed("xtensa"), - arch: Cow::Borrowed("xtensa"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("espidf"), - env: Cow::Borrowed("newlib"), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("xtensa-none-elf"), + full_arch: "xtensa", + arch: "xtensa", + vendor: "espressif", + os: "espidf", + env: "newlib", + abi: "", + unversioned_llvm_target: "xtensa-none-elf", }, ), ( "xtensa-esp32s3-none-elf", TargetInfo { - full_arch: Cow::Borrowed("xtensa"), - arch: Cow::Borrowed("xtensa"), - vendor: Cow::Borrowed("espressif"), - os: Cow::Borrowed("none"), - env: Cow::Borrowed(""), - abi: Cow::Borrowed(""), - unversioned_llvm_target: Cow::Borrowed("xtensa-none-elf"), + full_arch: "xtensa", + arch: "xtensa", + vendor: "espressif", + os: "none", + env: "", + abi: "", + unversioned_llvm_target: "xtensa-none-elf", }, ), ]; diff --git a/src/target/llvm.rs b/src/target/llvm.rs index ab1d1eea6..09f19e2c7 100644 --- a/src/target/llvm.rs +++ b/src/target/llvm.rs @@ -2,9 +2,9 @@ use std::borrow::Cow; use super::TargetInfo; -impl TargetInfo { +impl<'a> TargetInfo<'a> { /// The versioned LLVM/Clang target triple. - pub(crate) fn versioned_llvm_target(&self, version: Option<&str>) -> Cow<'_, str> { + pub(crate) fn versioned_llvm_target(&self, version: Option<&str>) -> Cow<'a, str> { if let Some(version) = version { // Only support versioned Apple targets for now. assert_eq!(self.vendor, "apple"); @@ -22,7 +22,7 @@ impl TargetInfo { format!("{arch}-{vendor}-{os}{version}") }) } else { - Cow::Borrowed(&self.unversioned_llvm_target) + Cow::Borrowed(self.unversioned_llvm_target) } } } diff --git a/src/target/parser.rs b/src/target/parser.rs new file mode 100644 index 000000000..4ee142cf6 --- /dev/null +++ b/src/target/parser.rs @@ -0,0 +1,130 @@ +use std::{env, str::FromStr}; + +use crate::{ + target::{llvm, TargetInfo}, + utilities::OnceLock, + Error, ErrorKind, +}; + +#[derive(Debug)] +struct TargetInfoParserInner { + full_arch: Box, + arch: Box, + vendor: Box, + os: Box, + env: Box, + abi: Box, + unversioned_llvm_target: Box, +} + +impl TargetInfoParserInner { + fn from_cargo_environment_variables() -> Result { + // `TARGET` must be present. + // + // No need to emit `rerun-if-env-changed` for this, + // as it is controlled by Cargo itself. + #[allow(clippy::disallowed_methods)] + let target_triple = env::var("TARGET").map_err(|err| { + Error::new( + ErrorKind::EnvVarNotFound, + format!("failed reading TARGET: {err}"), + ) + })?; + + // Parse the full architecture name from the target triple. + let (full_arch, _rest) = target_triple.split_once('-').ok_or(Error::new( + ErrorKind::InvalidTarget, + format!("target `{target_triple}` had an unknown architecture"), + ))?; + + let cargo_env = |name, fallback: Option<&str>| -> Result, Error> { + // No need to emit `rerun-if-env-changed` for these, + // as they are controlled by Cargo itself. + #[allow(clippy::disallowed_methods)] + match env::var(name) { + Ok(var) => Ok(var.into_boxed_str()), + Err(err) => match fallback { + Some(fallback) => Ok(fallback.into()), + None => Err(Error::new( + ErrorKind::EnvVarNotFound, + format!("did not find fallback information for target `{target_triple}`, and failed reading {name}: {err}"), + )), + }, + } + }; + + // Prefer to use `CARGO_ENV_*` if set, since these contain the most + // correct information relative to the current `rustc`, and makes it + // possible to support custom target JSON specs unknown to `rustc`. + // + // NOTE: If the user is using an older `rustc`, that data may be older + // than our pre-generated data, but we still prefer Cargo's view of + // the world, since at least `cc` won't differ from `rustc` in that + // case. + // + // These may not be set in case the user depended on being able to + // just set `TARGET` outside of build scripts; in those cases, fall + // back back to data from the known set of target triples instead. + // + // See discussion in #1225 for further details. + let fallback_target = TargetInfo::from_str(&target_triple).ok(); + let ft = fallback_target.as_ref(); + let arch = cargo_env("CARGO_CFG_TARGET_ARCH", ft.map(|t| t.arch))?; + let vendor = cargo_env("CARGO_CFG_TARGET_VENDOR", ft.map(|t| t.vendor))?; + let os = cargo_env("CARGO_CFG_TARGET_OS", ft.map(|t| t.os))?; + let env = cargo_env("CARGO_CFG_TARGET_ENV", ft.map(|t| t.env))?; + // `target_abi` was stabilized in Rust 1.78, which is higher than our + // MSRV, so it may not always be available; In that case, fall back to + // `""`, which is _probably_ correct for unknown target triples. + let abi = cargo_env("CARGO_CFG_TARGET_ABI", ft.map(|t| t.abi)) + .unwrap_or_else(|_| String::default().into_boxed_str()); + + // Prefer `rustc`'s LLVM target triple information. + let unversioned_llvm_target = match fallback_target { + Some(ft) => ft.unversioned_llvm_target.to_string(), + None => llvm::guess_llvm_target_triple(full_arch, &vendor, &os, &env, &abi), + }; + + Ok(Self { + full_arch: full_arch.to_string().into_boxed_str(), + arch, + vendor, + os, + env, + abi, + unversioned_llvm_target: unversioned_llvm_target.into_boxed_str(), + }) + } +} + +/// Parser for [`TargetInfo`], contains cached information. +#[derive(Default, Debug)] +pub(crate) struct TargetInfoParser(OnceLock>); + +impl TargetInfoParser { + pub fn parse_from_cargo_environment_variables(&self) -> Result, Error> { + match self + .0 + .get_or_init(TargetInfoParserInner::from_cargo_environment_variables) + { + Ok(TargetInfoParserInner { + full_arch, + arch, + vendor, + os, + env, + abi, + unversioned_llvm_target, + }) => Ok(TargetInfo { + full_arch, + arch, + vendor, + os, + env, + abi, + unversioned_llvm_target, + }), + Err(e) => Err(e.clone()), + } + } +} diff --git a/src/utilities.rs b/src/utilities.rs index 073e617b6..7a8a94933 100644 --- a/src/utilities.rs +++ b/src/utilities.rs @@ -1,7 +1,12 @@ use std::{ + cell::UnsafeCell, ffi::OsStr, fmt::{self, Write}, + marker::PhantomData, + mem::MaybeUninit, + panic::{RefUnwindSafe, UnwindSafe}, path::Path, + sync::Once, }; pub(super) struct JoinOsStrs<'a, T> { @@ -43,3 +48,83 @@ where } } } + +pub(crate) struct OnceLock { + once: Once, + value: UnsafeCell>, + _marker: PhantomData, +} + +impl Default for OnceLock { + fn default() -> Self { + Self::new() + } +} + +impl OnceLock { + pub(crate) const fn new() -> Self { + Self { + once: Once::new(), + value: UnsafeCell::new(MaybeUninit::uninit()), + _marker: PhantomData, + } + } + + #[inline] + fn is_initialized(&self) -> bool { + self.once.is_completed() + } + + unsafe fn get_unchecked(&self) -> &T { + debug_assert!(self.is_initialized()); + #[allow(clippy::needless_borrow)] + #[allow(unused_unsafe)] + unsafe { + (&*self.value.get()).assume_init_ref() + } + } + + pub(crate) fn get_or_init(&self, f: impl FnOnce() -> T) -> &T { + self.once.call_once(|| { + unsafe { &mut *self.value.get() }.write(f()); + }); + unsafe { self.get_unchecked() } + } + + pub(crate) fn get(&self) -> Option<&T> { + if self.is_initialized() { + // Safe b/c checked is_initialized + Some(unsafe { self.get_unchecked() }) + } else { + None + } + } +} + +impl fmt::Debug for OnceLock { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut d = f.debug_tuple("OnceLock"); + match self.get() { + Some(v) => d.field(v), + None => d.field(&format_args!("")), + }; + d.finish() + } +} + +unsafe impl Sync for OnceLock {} +unsafe impl Send for OnceLock {} + +impl RefUnwindSafe for OnceLock {} +impl UnwindSafe for OnceLock {} + +impl Drop for OnceLock { + #[inline] + fn drop(&mut self) { + if self.once.is_completed() { + // SAFETY: The cell is initialized and being dropped, so it can't + // be accessed again. + unsafe { self.value.get_mut().assume_init_drop() }; + } + } +} diff --git a/src/windows/find_tools.rs b/src/windows/find_tools.rs index 389ba7695..c2f425f1d 100644 --- a/src/windows/find_tools.rs +++ b/src/windows/find_tools.rs @@ -122,7 +122,7 @@ pub(crate) fn find_tool_inner( } // We only need the arch. - let target = TargetArch(&target.full_arch); + let target = TargetArch(target.full_arch); // Looks like msbuild isn't located in the same location as other tools like // cl.exe and lib.exe.