@@ -1877,46 +1877,46 @@ pub enum Architecture {
18771877}
18781878
18791879impl Architecture {
1880- pub fn as_str ( & self ) -> & ' static str {
1880+ pub const fn desc_symbol ( & self ) -> Symbol {
18811881 match self {
1882- Self :: AArch64 => " aarch64" ,
1883- Self :: AmdGpu => " amdgpu" ,
1884- Self :: Arm => " arm" ,
1885- Self :: Arm64EC => " arm64ec" ,
1886- Self :: Avr => " avr" ,
1887- Self :: Bpf => " bpf" ,
1888- Self :: CSKY => " csky" ,
1889- Self :: Hexagon => " hexagon" ,
1890- Self :: LoongArch32 => " loongarch32" ,
1891- Self :: LoongArch64 => " loongarch64" ,
1892- Self :: M68k => " m68k" ,
1893- Self :: Mips => " mips" ,
1894- Self :: Mips32r6 => " mips32r6" ,
1895- Self :: Mips64 => " mips64" ,
1896- Self :: Mips64r6 => " mips64r6" ,
1897- Self :: Msp430 => " msp430" ,
1898- Self :: Nvptx64 => " nvptx64" ,
1899- Self :: PowerPC => " powerpc" ,
1900- Self :: PowerPC64 => " powerpc64" ,
1901- Self :: PowerPC64LE => " powerpc64le" ,
1902- Self :: RiscV32 => " riscv32" ,
1903- Self :: RiscV64 => " riscv64" ,
1904- Self :: S390x => " s390x" ,
1905- Self :: Sparc => " sparc" ,
1906- Self :: Sparc64 => " sparc64" ,
1907- Self :: SpirV => " spirv" ,
1908- Self :: Wasm32 => " wasm32" ,
1909- Self :: Wasm64 => " wasm64" ,
1910- Self :: X86 => " x86" ,
1911- Self :: X86_64 => " x86_64" ,
1912- Self :: Xtensa => " xtensa" ,
1882+ Self :: AArch64 => sym :: aarch64,
1883+ Self :: AmdGpu => sym :: amdgpu,
1884+ Self :: Arm => sym :: arm,
1885+ Self :: Arm64EC => sym :: arm64ec,
1886+ Self :: Avr => sym :: avr,
1887+ Self :: Bpf => sym :: bpf,
1888+ Self :: CSKY => sym :: csky,
1889+ Self :: Hexagon => sym :: hexagon,
1890+ Self :: LoongArch32 => sym :: loongarch32,
1891+ Self :: LoongArch64 => sym :: loongarch64,
1892+ Self :: M68k => sym :: m68k,
1893+ Self :: Mips => sym :: mips,
1894+ Self :: Mips32r6 => sym :: mips32r6,
1895+ Self :: Mips64 => sym :: mips64,
1896+ Self :: Mips64r6 => sym :: mips64r6,
1897+ Self :: Msp430 => sym :: msp430,
1898+ Self :: Nvptx64 => sym :: nvptx64,
1899+ Self :: PowerPC => sym :: powerpc,
1900+ Self :: PowerPC64 => sym :: powerpc64,
1901+ Self :: PowerPC64LE => sym :: powerpc64le,
1902+ Self :: RiscV32 => sym :: riscv32,
1903+ Self :: RiscV64 => sym :: riscv64,
1904+ Self :: S390x => sym :: s390x,
1905+ Self :: Sparc => sym :: sparc,
1906+ Self :: Sparc64 => sym :: sparc64,
1907+ Self :: SpirV => sym :: spirv,
1908+ Self :: Wasm32 => sym :: wasm32,
1909+ Self :: Wasm64 => sym :: wasm64,
1910+ Self :: X86 => sym :: x86,
1911+ Self :: X86_64 => sym :: x86_64,
1912+ Self :: Xtensa => sym :: xtensa,
19131913 }
19141914 }
19151915}
19161916
19171917impl fmt:: Display for Architecture {
19181918 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1919- f. write_str ( self . as_str ( ) )
1919+ f. write_str ( self . desc_symbol ( ) . as_str ( ) )
19201920 }
19211921}
19221922
@@ -1965,7 +1965,7 @@ pub struct TargetMetadata {
19651965
19661966impl ToJson for Architecture {
19671967 fn to_json ( & self ) -> Json {
1968- self . as_str ( ) . to_json ( )
1968+ self . desc_symbol ( ) . as_str ( ) . to_json ( )
19691969 }
19701970}
19711971
0 commit comments