[BasicContainers, ContainersPreview, DequeModule] More SuppressedAssociatedTypesWithDefaults fixups

This commit is contained in:
Karoy Lorentey committed 2026-03-26 18:12:41 -07:00
1 parent 419e2f7df2
commit d2d3b917ca
26 files changed
+129 -42

No files matched your search

@@ -234,7 +234,9 @@ extension RigidArray where Element: ~Copyable {
>(
addingCount newItemCount: Int,
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
try self.append(addingCount: newItemCount) { target throws(E) in
while !target.isFull {
guard try producer.generate(into: &target) else { break }
@@ -261,7 +263,9 @@ extension RigidArray where Element: ~Copyable {
P: Producer<Element, E> & ~Copyable & ~Escapable
>(
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
var done = false
while !done {
try self.append(addingCount: freeCapacity) { target throws(E) in
@@ -304,7 +304,9 @@ extension RigidArray where Element: ~Copyable {
addingCount newItemCount: Int,
from producer: inout P,
at index: Int
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
try insert(addingCount: newItemCount, at: index) { target throws(E) in
while !target.isFull, try producer.generate(into: &target) {
// Do nothing
@@ -454,7 +454,9 @@ extension RigidArray where Element: ~Copyable {
removing subrange: Range<Int>,
addingCount newItemCount: Int,
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
try replace(
removing: subrange,
addingCount: newItemCount
@@ -57,7 +57,9 @@ extension RigidSet where Element: ~Copyable {
>(
capacity: Int,
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
self.init(capacity: capacity)
try self.insert(maximumCount: capacity, from: &producer)
}
@@ -173,7 +173,9 @@ extension RigidSet where Element: ~Copyable {
>(
maximumCount: Int? = nil,
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
try self.insert(
maximumCount: maximumCount ?? freeCapacity
) { target throws(E) in
@@ -206,7 +206,9 @@ extension UniqueArray where Element: ~Copyable {
>(
addingCount newItemCount: Int,
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
_ensureFreeCapacity(newItemCount)
try _storage.append(addingCount: newItemCount, from: &producer)
}
@@ -230,7 +232,9 @@ extension UniqueArray where Element: ~Copyable {
P: Producer<Element, E> & ~Copyable & ~Escapable
>(
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
var done = false
while !done {
let c = Swift.max(producer.underestimatedCount, 1)
@@ -267,7 +267,9 @@ extension UniqueArray where Element: ~Copyable {
addingCount newItemCount: Int,
from producer: inout P,
at index: Int
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
try insert(addingCount: newItemCount, at: index) { target throws(E) in
while !target.isFull, try producer.generate(into: &target) {
// Do nothing
@@ -392,7 +392,9 @@ extension UniqueArray where Element: ~Copyable {
removing subrange: Range<Int>,
addingCount newItemCount: Int,
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
try replace(removing: subrange, addingCount: newItemCount) { target throws(E) in
while !target.isFull, try producer.generate(into: &target) {
// Do nothing
@@ -57,7 +57,9 @@ extension UniqueSet where Element: ~Copyable {
P: Producer<Element, E> & ~Copyable & ~Escapable
>(
minimumCapacity: Int? = nil, from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
let c = producer.underestimatedCount
if let minimumCapacity {
self.init(minimumCapacity: Swift.min(minimumCapacity, c))
@@ -86,7 +86,9 @@ extension UniqueSet where Element: ~Copyable {
P: Producer<Element, E> & ~Copyable & ~Escapable
>(
from producer: inout P
) throws(E) {
) throws(E)
where P.Element: ~Copyable
{
var done = false
while !done {
_ensureFreeCapacity(Swift.max(producer.underestimatedCount, 1))