PT-2026-66823 · Crates.Io · Enum-Map

Published

2026-07-21

·

Updated

2026-07-21

None

No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
Affected versions of this crate did not require the element type of the Array associated type in the Enum trait to match the array's generic parameter V.
This can result in type confusion, and consequently memory corruption, when a manual Enum implementation declares an Array<V> whose elements are not actually of type V:
rust
struct IntentionallyWrong;

impl Enum for IntentionallyWrong {
  type Array<V> = [String; 4];

  fn from usize( : usize) -> Self {
    IntentionallyWrong
  }

  fn into usize(self) -> usize {
    0
  }
}

enum map! { IntentionallyWrong => 42 };
The flaw was corrected in commit 7a8b815432 by adding a Value = V bound to the Array type in the Enum trait.
Found an issue in the description? Have something to add? Feel free to write us 👾

Related Identifiers

RUSTSEC-2026-0218

Affected Products

Enum-Map