File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -308,3 +308,18 @@ public struct _NameMap: ExpressibleByDictionaryLiteral {
308
308
return jsonToNumberMap [ n]
309
309
}
310
310
}
311
+
312
+ #if swift(>=5.5) && canImport(_Concurrency)
313
+ // The `_NameMap` (and supporting types) are only mutated during their initial
314
+ // creation, then for the lifetime of the a process they are constant. Swift
315
+ // 5.10 flags the generated `_protobuf_nameMap` usages as a problem
316
+ // (https://github.com/apple/swift-protobuf/issues/1560) so this silences those
317
+ // warnings since the usage has been deemed safe.
318
+ //
319
+ // https://github.com/apple/swift-protobuf/issues/1561 is also opened to revisit
320
+ // the `_NameMap` generally as it dates back to the days before Swift perferred
321
+ // the UTF-8 internal encoding.
322
+ extension _NameMap : Sendable { }
323
+ extension _NameMap . Name : @unchecked Sendable { }
324
+ extension InternPool : @unchecked Sendable { }
325
+ #endif
You can’t perform that action at this time.
0 commit comments