mirror of
https://github.com/apple/swift-nio-extras
synced 2026-11-24 04:37:58 +00:00
Workaround a compiler issue in Swift 6.1 with non-copyable types and exclusivity checking. ### Motivation: Code introduced in #298, led to a runtime crash when compiling with `-Xswiftc -enforce-exclusivity=unchecked`. This fixes the issue by removing non-copyable types from the implementation, whilst retaining a fix for copy-on-write behaviour. ### Modifications: - Change LifecycleStateMachine to not use non-copyable types - Use a `.modifying` state instead to prevent copy-on-write ### Result: No runtime crash when compiling with exclusivity checks disabled on swift 6.1, behaviour otherwise unchanged, apart from possible performance loss from not using non-copyable types.