mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 16:48:58 +00:00
976a5d9713
EventName::mask() recursed forever for the three internal leaf events (ObjectRemovedAbortMultipartUpload, ObjectCreatedCreateMultipartUpload, ObjectRemovedDeleteObjects): their discriminants fall past LAST_SINGLE_TYPE_VALUE so mask() took the compound branch, but expand() returns vec![*self] for them, so mask() called itself with the same value and overflowed the stack. Detect the self-expanding leaf case (expand() yields exactly self) and give it a dedicated bit derived from its discriminant. Those bits sit above the single-type bits, so they never collide with each other or with any compound 'All' mask. Add exhaustive regression tests: every variant's mask() terminates, the three internal masks are non-zero and mutually distinct and disjoint from the single-type bits, and Everything covers all single-type bits. Refs: https://github.com/rustfs/backlog/issues/965