From a1122a10881ca8ec51dd42a64c7d1f9d6b367cb0 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 6 Nov 2025 23:56:29 -0500 Subject: [PATCH] rustc_target: rename Arch::{Uknown,Other} Prepare for additional enums like Vendor and Os which have true `Unknown` variants. We want to use the same name for the escape hatch for all of these, thus rename this one. --- compiler/rustc_target/src/asm/mod.rs | 2 +- compiler/rustc_target/src/callconv/mod.rs | 2 +- compiler/rustc_target/src/spec/mod.rs | 6 +++--- compiler/rustc_target/src/target_features.rs | 4 ++-- src/tools/miri/src/shims/alloc.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs index cd7d9125d7b5..57d9cdad454a 100644 --- a/compiler/rustc_target/src/asm/mod.rs +++ b/compiler/rustc_target/src/asm/mod.rs @@ -273,7 +273,7 @@ impl InlineAsmArch { Arch::Msp430 => Some(Self::Msp430), Arch::M68k => Some(Self::M68k), Arch::CSky => Some(Self::CSKY), - Arch::AmdGpu | Arch::Xtensa | Arch::Unknown(_) => None, + Arch::AmdGpu | Arch::Xtensa | Arch::Other(_) => None, } } } diff --git a/compiler/rustc_target/src/callconv/mod.rs b/compiler/rustc_target/src/callconv/mod.rs index 147b17b24bb5..878340143582 100644 --- a/compiler/rustc_target/src/callconv/mod.rs +++ b/compiler/rustc_target/src/callconv/mod.rs @@ -702,7 +702,7 @@ impl<'a, Ty> FnAbi<'a, Ty> { Arch::RiscV32 | Arch::RiscV64 => riscv::compute_abi_info(cx, self), Arch::Wasm32 | Arch::Wasm64 => wasm::compute_abi_info(cx, self), Arch::Bpf => bpf::compute_abi_info(cx, self), - arch @ (Arch::PowerPC64LE | Arch::SpirV | Arch::Unknown(_)) => { + arch @ (Arch::PowerPC64LE | Arch::SpirV | Arch::Other(_)) => { panic!("no lowering implemented for {arch}") } } diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 314c3177c144..df9e29073872 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1884,7 +1884,7 @@ crate::target_spec_enum! { X86_64 = "x86_64", Xtensa = "xtensa", } - other_variant = Unknown; + other_variant = Other; } impl Arch { @@ -1921,7 +1921,7 @@ impl Arch { Self::X86 => sym::x86, Self::X86_64 => sym::x86_64, Self::Xtensa => sym::xtensa, - Self::Unknown(name) => rustc_span::Symbol::intern(name), + Self::Other(name) => rustc_span::Symbol::intern(name), } } } @@ -3298,7 +3298,7 @@ impl Target { | Arch::SpirV | Arch::Wasm32 | Arch::Wasm64 - | Arch::Unknown(_) => return None, + | Arch::Other(_) => return None, }) } diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index 1789e52ed26f..b2c8c19ca898 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -977,7 +977,7 @@ impl Target { | Arch::PowerPC64LE | Arch::SpirV | Arch::Xtensa - | Arch::Unknown(_) => &[], + | Arch::Other(_) => &[], } } @@ -1006,7 +1006,7 @@ impl Target { | Arch::PowerPC64LE | Arch::SpirV | Arch::Xtensa - | Arch::Unknown(_) => &[], + | Arch::Other(_) => &[], } } diff --git a/src/tools/miri/src/shims/alloc.rs b/src/tools/miri/src/shims/alloc.rs index 217069b8b5d9..7163d96d9331 100644 --- a/src/tools/miri/src/shims/alloc.rs +++ b/src/tools/miri/src/shims/alloc.rs @@ -54,7 +54,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { | Arch::Nvptx64 | Arch::PowerPC64LE | Arch::SpirV - | Arch::Unknown(_)) => bug!("unsupported target architecture for malloc: `{arch}`"), + | Arch::Other(_)) => bug!("unsupported target architecture for malloc: `{arch}`"), }; // The C standard only requires sufficient alignment for any *type* with size less than or // equal to the size requested. Types one can define in standard C seem to never have an alignment