@@ -1045,6 +1045,48 @@ pub mod consts {
10451045 #[ stable( feature = "env" , since = "1.0.0" ) ]
10461046 pub const ARCH : & str = env ! ( "STD_ENV_ARCH" ) ;
10471047
1048+ /// A string identifying the platform for which the standard library was built
1049+ #[ doc = concat ! ( "(`\" " , env!( "STD_ENV_HOST_TUPLE" ) , "\" `)." ) ]
1050+ ///
1051+ /// This is also known as a *host tuple*, *target triple*, or *target platform*.
1052+ ///
1053+ /// The exact format of this string may vary. For details about the platform,
1054+ /// use the [`ARCH`], [`FAMILY`], and [`OS`] constants.
1055+ ///
1056+ /// For platform-specific code, use the [`#[cfg]` attribute][cfg] or [`cfg!` macro](crate::cfg!)
1057+ /// with the predefined [`target_*` options][target_cfg].
1058+ ///
1059+ /// When cross-compiling, the `HOST` seen by build scripts and procedural macros is going
1060+ /// to be the platform running the cross-compilation, not the target platform being built.
1061+ ///
1062+ /// [cfg]: ../../../reference/conditional-compilation.html#the-cfg-attribute
1063+ /// [target_cfg]: ../../../reference/conditional-compilation.html#r-cfg.options.set
1064+ ///
1065+ /// <details><summary>Example values</summary>
1066+ ///
1067+ /// * `"aarch64-apple-ios-sim"`
1068+ /// * `"aarch64-unknown-linux-gnu"`
1069+ /// * `"aarch64-unknown-linux-gnu_ilp32"`
1070+ /// * `"avr-none"`
1071+ /// * `"loongarch64-unknown-none-softfloat"`
1072+ /// * `"mipsel-sony-psx"`
1073+ /// * `"nvptx64-nvidia-cuda"`
1074+ /// * `"powerpc64le-unknown-freebsd"`
1075+ /// * `"riscv64-linux-android"`
1076+ /// * `"sparcv9-sun-solaris"`
1077+ /// * `"thumbv7a-uwp-windows-msvc"`
1078+ /// * `"thumbv7neon-unknown-linux-musleabihf"`
1079+ /// * `"thumbv8m.main-none-eabihf"`
1080+ /// * `"wasm32-wasip1"`
1081+ /// * `"x86_64-pc-windows-msvc"`
1082+ /// * `"x86_64-unknown-redox"`
1083+ /// * `"xtensa-esp32s3-none-elf"`
1084+ ///
1085+ /// </details>
1086+ #[ unstable( feature = "env_host_tuple" , issue = "146295" ) ]
1087+ #[ doc( alias = "TARGET" ) ]
1088+ pub const HOST : & str = env ! ( "STD_ENV_HOST_TUPLE" ) ;
1089+
10481090 /// A string describing the family of the operating system.
10491091 /// An example value may be: `"unix"`, or `"windows"`.
10501092 ///
0 commit comments