From a107072a19e778bf5e7a5eecac62846f1ca4e4c6 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Mon, 23 Oct 2023 19:00:13 +0100 Subject: [PATCH] Mark retroactive conformances appropriately. (#2569) Motivation: In nightly Swift, we now need to mark retroactive conformances when they are intentional. These conformances are safe for us, so we can safely suppress the warnings. Modifications: - Mark NIOFoundationCompat retroactive conformances. Result: Nightly builds work again --- .../NIOFoundationCompat/ByteBuffer-foundation.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift b/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift index 271707ad83..fd6362bf7f 100644 --- a/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift +++ b/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift @@ -375,9 +375,17 @@ extension ByteBufferAllocator { } // MARK: - Conformances +#if compiler(>=5.11) +extension ByteBufferView: @retroactive ContiguousBytes {} +extension ByteBufferView: @retroactive DataProtocol {} +extension ByteBufferView: @retroactive MutableDataProtocol {} +#else extension ByteBufferView: ContiguousBytes {} +extension ByteBufferView: DataProtocol {} +extension ByteBufferView: MutableDataProtocol {} +#endif -extension ByteBufferView: DataProtocol { +extension ByteBufferView { public typealias Regions = CollectionOfOne public var regions: CollectionOfOne { @@ -385,8 +393,6 @@ extension ByteBufferView: DataProtocol { } } -extension ByteBufferView: MutableDataProtocol {} - // MARK: - Data extension Data {