See: #310 (comment)
Given a flags type with two flags, BIT = 0b0000_0001 and MASK = 0b0001_1110, formatting the value 3 should result in BIT | 0x2, but instead it gives BIT. That extra bit gets lost, so doesn't roundtrip. The problem seems to be in the generated iter_names method.