UnionFields represents a set of unique field ids paired with unique data types. Internally, it is stored as a list of (id, data type) tuples. However, because UnionFields currently derives PartialEq, equality is determined by the raw tuple list ordering rather than by set semantics
This leads to incorrect behavior, such as the following assertion failing even though the logical sets are identical:
assert_eq!(
UnionFields::from(&[(0, t1), (1, t2)]),
UnionFields::from(&[(1, t2), (0, t1)])
);