File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 129
129
/// ### Sendable Metatypes
130
130
///
131
131
/// Metatypes such as `Int.Type` implicitly conform to the `Sendable` protocol.
132
+ #if $NoncopyableGenerics && $NonescapableTypes
133
+ @_marker public protocol Sendable : ~ Copyable, ~ Escapable { }
134
+ #elseif $NoncopyableGenerics
135
+ @_marker public protocol Sendable : ~ Copyable { }
136
+ #else
132
137
@_marker public protocol Sendable { }
138
+ #endif
133
139
///
134
140
/// A type whose values can safely be passed across concurrency domains by copying,
135
141
/// but which disables some safety checking at the conformance site.
Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ protocol Test: ~Copyable {
101
101
init ? ( ) // expected-error {{noncopyable types cannot have failable initializers yet}}
102
102
}
103
103
104
+ struct NoncopyableAndSendable : ~ Copyable, Sendable { }
105
+
104
106
/// ---------------
105
107
106
108
// expected-note@+2 {{consider adding '~Copyable' to generic enum 'Maybe'}}
You can’t perform that action at this time.
0 commit comments