Skip to content

Commit e381171

Browse files
committed
rustc_target: allow unenumerated architectures
1 parent d5f0054 commit e381171

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/shims/alloc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
2020
// `library/std/src/sys/alloc/mod.rs` (where this is called `MIN_ALIGN`) and should
2121
// be kept in sync.
2222
let os = this.tcx.sess.target.os.as_ref();
23-
let max_fundamental_align = match this.tcx.sess.target.arch {
23+
let max_fundamental_align = match &this.tcx.sess.target.arch {
2424
Arch::RiscV32 if matches!(os, "espidf" | "zkvm") => 4,
2525
Arch::Xtensa if matches!(os, "espidf") => 4,
2626
Arch::X86
@@ -53,7 +53,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5353
| Arch::Msp430
5454
| Arch::Nvptx64
5555
| Arch::PowerPC64LE
56-
| Arch::SpirV) => bug!("unsupported target architecture for malloc: `{arch}`"),
56+
| Arch::SpirV
57+
| Arch::Unknown(_)) => bug!("unsupported target architecture for malloc: `{arch}`"),
5758
};
5859
// The C standard only requires sufficient alignment for any *type* with size less than or
5960
// equal to the size requested. Types one can define in standard C seem to never have an alignment

0 commit comments

Comments
 (0)