Rollup merge of #128535 - mmvanheusden:master, r=workingjubilee
Format `std::env::consts` docstrings with markdown backticks This clarifies possible outputs the constants might be. **Before:** -- <img src="https://github.com/user-attachments/assets/8ee8772a-7562-42a2-89be-f8772b76dbd5" width="500px"> **After:** -- <img src="https://github.com/user-attachments/assets/4632e5e2-db3e-4372-b13e-006cc1701eb1" width="500px">
This commit is contained in:
commit
11fe22c3fb
@ -935,106 +935,147 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|||||||
pub mod consts {
|
pub mod consts {
|
||||||
use crate::sys::env::os;
|
use crate::sys::env::os;
|
||||||
|
|
||||||
/// A string describing the architecture of the CPU that is currently
|
/// A string describing the architecture of the CPU that is currently in use.
|
||||||
/// in use.
|
/// An example value may be: `"x86"`, `"arm"` or `"riscv64"`.
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// <details><summary>Full list of possible values</summary>
|
||||||
///
|
///
|
||||||
/// - x86
|
/// * `"x86"`
|
||||||
/// - x86_64
|
/// * `"x86_64"`
|
||||||
/// - arm
|
/// * `"arm"`
|
||||||
/// - aarch64
|
/// * `"aarch64"`
|
||||||
/// - loongarch64
|
/// * `"m68k"`
|
||||||
/// - m68k
|
/// * `"mips"`
|
||||||
/// - csky
|
/// * `"mips32r6"`
|
||||||
/// - mips
|
/// * `"mips64"`
|
||||||
/// - mips64
|
/// * `"mips64r6"`
|
||||||
/// - powerpc
|
/// * `"csky"`
|
||||||
/// - powerpc64
|
/// * `"powerpc"`
|
||||||
/// - riscv64
|
/// * `"powerpc64"`
|
||||||
/// - s390x
|
/// * `"riscv32"`
|
||||||
/// - sparc64
|
/// * `"riscv64"`
|
||||||
|
/// * `"s390x"`
|
||||||
|
/// * `"sparc"`
|
||||||
|
/// * `"sparc64"`
|
||||||
|
/// * `"hexagon"`
|
||||||
|
/// * `"loongarch64"`
|
||||||
|
///
|
||||||
|
/// </details>
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const ARCH: &str = env!("STD_ENV_ARCH");
|
pub const ARCH: &str = env!("STD_ENV_ARCH");
|
||||||
|
|
||||||
/// The family of the operating system. Example value is `unix`.
|
/// A string describing the family of the operating system.
|
||||||
|
/// An example value may be: `"unix"`, or `"windows"`.
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// This value may be an empty string if the family is unknown.
|
||||||
///
|
///
|
||||||
/// - unix
|
/// <details><summary>Full list of possible values</summary>
|
||||||
/// - windows
|
///
|
||||||
|
/// * `"unix"`
|
||||||
|
/// * `"windows"`
|
||||||
|
/// * `"itron"`
|
||||||
|
/// * `"wasm"`
|
||||||
|
/// * `""`
|
||||||
|
///
|
||||||
|
/// </details>
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const FAMILY: &str = os::FAMILY;
|
pub const FAMILY: &str = os::FAMILY;
|
||||||
|
|
||||||
/// A string describing the specific operating system in use.
|
/// A string describing the specific operating system in use.
|
||||||
/// Example value is `linux`.
|
/// An example value may be: `"linux"`, or `"freebsd"`.
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// <details><summary>Full list of possible values</summary>
|
||||||
///
|
///
|
||||||
/// - linux
|
/// * `"linux"`
|
||||||
/// - macos
|
/// * `"windows"`
|
||||||
/// - ios
|
/// * `"macos"`
|
||||||
/// - freebsd
|
/// * `"android"`
|
||||||
/// - dragonfly
|
/// * `"ios"`
|
||||||
/// - netbsd
|
/// * `"openbsd"`
|
||||||
/// - openbsd
|
/// * `"freebsd"`
|
||||||
/// - solaris
|
/// * `"netbsd"`
|
||||||
/// - android
|
/// * `"wasi"`
|
||||||
/// - windows
|
/// * `"hermit"`
|
||||||
|
/// * `"aix"`
|
||||||
|
/// * `"apple"`
|
||||||
|
/// * `"dragonfly"`
|
||||||
|
/// * `"emscripten"`
|
||||||
|
/// * `"espidf"`
|
||||||
|
/// * `"fortanix"`
|
||||||
|
/// * `"uefi"`
|
||||||
|
/// * `"fuchsia"`
|
||||||
|
/// * `"haiku"`
|
||||||
|
/// * `"hermit"`
|
||||||
|
/// * `"watchos"`
|
||||||
|
/// * `"visionos"`
|
||||||
|
/// * `"tvos"`
|
||||||
|
/// * `"horizon"`
|
||||||
|
/// * `"hurd"`
|
||||||
|
/// * `"illumos"`
|
||||||
|
/// * `"l4re"`
|
||||||
|
/// * `"nto"`
|
||||||
|
/// * `"redox"`
|
||||||
|
/// * `"solaris"`
|
||||||
|
/// * `"solid_asp3`
|
||||||
|
/// * `"vita"`
|
||||||
|
/// * `"vxworks"`
|
||||||
|
/// * `"xous"`
|
||||||
|
///
|
||||||
|
/// </details>
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const OS: &str = os::OS;
|
pub const OS: &str = os::OS;
|
||||||
|
|
||||||
/// Specifies the filename prefix used for shared libraries on this
|
/// Specifies the filename prefix, if any, used for shared libraries on this platform.
|
||||||
/// platform. Example value is `lib`.
|
/// This is either `"lib"` or an empty string. (`""`).
|
||||||
///
|
|
||||||
/// Some possible values:
|
|
||||||
///
|
|
||||||
/// - lib
|
|
||||||
/// - `""` (an empty string)
|
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const DLL_PREFIX: &str = os::DLL_PREFIX;
|
pub const DLL_PREFIX: &str = os::DLL_PREFIX;
|
||||||
|
|
||||||
/// Specifies the filename suffix used for shared libraries on this
|
/// Specifies the filename suffix, if any, used for shared libraries on this platform.
|
||||||
/// platform. Example value is `.so`.
|
/// An example value may be: `".so"`, `".elf"`, or `".dll"`.
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// The possible values are identical to those of [`DLL_EXTENSION`], but with the leading period included.
|
||||||
///
|
|
||||||
/// - .so
|
|
||||||
/// - .dylib
|
|
||||||
/// - .dll
|
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const DLL_SUFFIX: &str = os::DLL_SUFFIX;
|
pub const DLL_SUFFIX: &str = os::DLL_SUFFIX;
|
||||||
|
|
||||||
/// Specifies the file extension used for shared libraries on this
|
/// Specifies the file extension, if any, used for shared libraries on this platform that goes after the dot.
|
||||||
/// platform that goes after the dot. Example value is `so`.
|
/// An example value may be: `"so"`, `"elf"`, or `"dll"`.
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// <details><summary>Full list of possible values</summary>
|
||||||
///
|
///
|
||||||
/// - so
|
/// * `"so"`
|
||||||
/// - dylib
|
/// * `"dylib"`
|
||||||
/// - dll
|
/// * `"dll"`
|
||||||
|
/// * `"sgxs"`
|
||||||
|
/// * `"a"`
|
||||||
|
/// * `"elf"`
|
||||||
|
/// * `"wasm"`
|
||||||
|
/// * `""` (an empty string)
|
||||||
|
///
|
||||||
|
/// </details>
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const DLL_EXTENSION: &str = os::DLL_EXTENSION;
|
pub const DLL_EXTENSION: &str = os::DLL_EXTENSION;
|
||||||
|
|
||||||
/// Specifies the filename suffix used for executable binaries on this
|
/// Specifies the filename suffix, if any, used for executable binaries on this platform.
|
||||||
/// platform. Example value is `.exe`.
|
/// An example value may be: `".exe"`, or `".efi"`.
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// The possible values are identical to those of [`EXE_EXTENSION`], but with the leading period included.
|
||||||
///
|
|
||||||
/// - .exe
|
|
||||||
/// - .nexe
|
|
||||||
/// - .pexe
|
|
||||||
/// - `""` (an empty string)
|
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const EXE_SUFFIX: &str = os::EXE_SUFFIX;
|
pub const EXE_SUFFIX: &str = os::EXE_SUFFIX;
|
||||||
|
|
||||||
/// Specifies the file extension, if any, used for executable binaries
|
/// Specifies the file extension, if any, used for executable binaries on this platform.
|
||||||
/// on this platform. Example value is `exe`.
|
/// An example value may be: `"exe"`, or an empty string (`""`).
|
||||||
///
|
///
|
||||||
/// Some possible values:
|
/// <details><summary>Full list of possible values</summary>
|
||||||
///
|
///
|
||||||
/// - exe
|
/// * `"exe"`
|
||||||
/// - `""` (an empty string)
|
/// * `"efi"`
|
||||||
|
/// * `"js"`
|
||||||
|
/// * `"sgxs"`
|
||||||
|
/// * `"elf"`
|
||||||
|
/// * `"wasm"`
|
||||||
|
/// * `""` (an empty string)
|
||||||
|
///
|
||||||
|
/// </details>
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub const EXE_EXTENSION: &str = os::EXE_EXTENSION;
|
pub const EXE_EXTENSION: &str = os::EXE_EXTENSION;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user