Skip to content

Commit 24dc59c

Browse files
SE-0499: Add items caught during review (#3053)
1 parent e7deecb commit 24dc59c

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

proposals/0499-support-non-copyable-simple-protocols.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ extension Comparable where Self: ~Copyable & ~Escapable {
7272
protocol Hashable: Equatable & ~Copyable & ~Escapable { }
7373

7474
struct Hasher {
75-
mutating func combine<H: Hashable & ~Copyable & ~Escapable>(_ value: borrowing H)
75+
mutating func combine<
76+
H: Hashable & ~Copyable & ~Escapable
77+
>(_ value: borrowing H)
7678
}
7779

78-
extension Optional: Equatable where Wrapped: Equatable & ~Copyable & ~Escapable {
79-
public static func ==(lhs: borrowing Wrapped?, rhs: borrowing Wrapped?) -> Bool {
80+
extension Optional: Equatable
81+
where Wrapped: Equatable & ~Copyable & ~Escapable
82+
{
83+
public static func ==(
84+
lhs: borrowing Wrapped?, rhs: borrowing Wrapped?
85+
) -> Bool
8086
}
8187

8288
extension Optional: Hashable where Wrapped: Hashable & ~Copyable & ~Escapable {
@@ -92,10 +98,25 @@ protocol TextOutputStreamable: ~Copyable & ~Escapable { }
9298
protocol CustomStringConvertible: ~Copyable, ~Escapable { }
9399
protocol CustomDebugStringConvertible: ~Copyable, ~Escapable { }
94100

95-
extension Result: Equatable where Success: Equatable & ~Copyable, Failure: Equatable {
101+
extension String {
102+
public init<
103+
Subject: CustomStringConvertible & ~Copyable & ~Escapable
104+
>(describing instance: borrowing Subject)
105+
106+
public init<
107+
Subject: TextOutputStreamable & ~Copyable & ~Escapable
108+
>(describing instance: borrowing Subject)
109+
}
110+
111+
extension Result: Equatable
112+
where Success: Equatable & ~Copyable, Failure: Equatable
113+
{
96114
public static func ==(lhs: borrowing Self, rhs: borrowing Self) -> Bool
97115
}
98116

117+
extension Result: Hashable
118+
where Success: Hashable & ~Copyable & ~Escapable, Failure: Hashable { }
119+
99120
extension DefaultStringInterpolation
100121
mutating func appendInterpolation<T>(
101122
_ value: borrowing T

0 commit comments

Comments
 (0)