diff --git a/stdlib/public/core/UnsafeBufferPointer.swift.gyb b/stdlib/public/core/UnsafeBufferPointer.swift.gyb index a0242df85313b..b51808895ca3b 100644 --- a/stdlib/public/core/UnsafeBufferPointer.swift.gyb +++ b/stdlib/public/core/UnsafeBufferPointer.swift.gyb @@ -401,9 +401,9 @@ extension Unsafe${Mutable}BufferPointer { public init( @_nonEphemeral start: Unsafe${Mutable}Pointer?, count: Int ) { - _precondition( + _debugPrecondition( count >= 0, "Unsafe${Mutable}BufferPointer with negative count") - _precondition( + _debugPrecondition( count == 0 || start != nil, "Unsafe${Mutable}BufferPointer has a nil start and nonzero count") _position = start diff --git a/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb b/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb index 453791f2c60d3..5ba3945f1ae1a 100644 --- a/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb +++ b/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb @@ -432,8 +432,8 @@ extension Unsafe${Mutable}RawBufferPointer { public init( @_nonEphemeral start: Unsafe${Mutable}RawPointer?, count: Int ) { - _precondition(count >= 0, "${Self} with negative count") - _precondition(count == 0 || start != nil, + _debugPrecondition(count >= 0, "${Self} with negative count") + _debugPrecondition(count == 0 || start != nil, "${Self} has a nil start and nonzero count") _position = start _end = start.map { $0 + count }