Skip to content

Commit 171875d

Browse files
committed
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.
1 parent 6c5d3b2 commit 171875d

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

compiler/rustc_target/src/asm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl InlineAsmArch {
273273
Arch::Msp430 => Some(Self::Msp430),
274274
Arch::M68k => Some(Self::M68k),
275275
Arch::CSky => Some(Self::CSKY),
276-
Arch::AmdGpu | Arch::Xtensa | Arch::Unknown(_) => None,
276+
Arch::AmdGpu | Arch::Xtensa | Arch::Other(_) => None,
277277
}
278278
}
279279
}

compiler/rustc_target/src/callconv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
702702
Arch::RiscV32 | Arch::RiscV64 => riscv::compute_abi_info(cx, self),
703703
Arch::Wasm32 | Arch::Wasm64 => wasm::compute_abi_info(cx, self),
704704
Arch::Bpf => bpf::compute_abi_info(cx, self),
705-
arch @ (Arch::PowerPC64LE | Arch::SpirV | Arch::Unknown(_)) => {
705+
arch @ (Arch::PowerPC64LE | Arch::SpirV | Arch::Other(_)) => {
706706
panic!("no lowering implemented for {arch}")
707707
}
708708
}

compiler/rustc_target/src/spec/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ crate::target_spec_enum! {
18841884
X86_64 = "x86_64",
18851885
Xtensa = "xtensa",
18861886
}
1887-
other_variant = Unknown;
1887+
other_variant = Other;
18881888
}
18891889

18901890
impl Arch {
@@ -1921,7 +1921,7 @@ impl Arch {
19211921
Self::X86 => sym::x86,
19221922
Self::X86_64 => sym::x86_64,
19231923
Self::Xtensa => sym::xtensa,
1924-
Self::Unknown(name) => rustc_span::Symbol::intern(name),
1924+
Self::Other(name) => rustc_span::Symbol::intern(name),
19251925
}
19261926
}
19271927
}
@@ -3294,7 +3294,7 @@ impl Target {
32943294
| Arch::SpirV
32953295
| Arch::Wasm32
32963296
| Arch::Wasm64
3297-
| Arch::Unknown(_) => return None,
3297+
| Arch::Other(_) => return None,
32983298
})
32993299
}
33003300

compiler/rustc_target/src/target_features.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ impl Target {
977977
| Arch::PowerPC64LE
978978
| Arch::SpirV
979979
| Arch::Xtensa
980-
| Arch::Unknown(_) => &[],
980+
| Arch::Other(_) => &[],
981981
}
982982
}
983983

@@ -1006,7 +1006,7 @@ impl Target {
10061006
| Arch::PowerPC64LE
10071007
| Arch::SpirV
10081008
| Arch::Xtensa
1009-
| Arch::Unknown(_) => &[],
1009+
| Arch::Other(_) => &[],
10101010
}
10111011
}
10121012

src/tools/miri/src/shims/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5454
| Arch::Nvptx64
5555
| Arch::PowerPC64LE
5656
| Arch::SpirV
57-
| Arch::Unknown(_)) => bug!("unsupported target architecture for malloc: `{arch}`"),
57+
| Arch::Other(_)) => bug!("unsupported target architecture for malloc: `{arch}`"),
5858
};
5959
// The C standard only requires sufficient alignment for any *type* with size less than or
6060
// equal to the size requested. Types one can define in standard C seem to never have an alignment

0 commit comments

Comments
 (0)