Commit 69fa54d
committed
Suppress compiler warnings about Errors with non-Sendable members.
A type conforming to `Error` must be `Sendable`, but `DelimiterLexError` and
`CompilerLexError` carry source locations represented by `UnsafeRawPointer`,
which is inherently non-`Sendable`. The compiler diagnoses the failure to meet
`Sendable` requirements on these error types, which will prevent Swift 6 adoption
in `_RegexParser` and also generates build log spam every time the compiler and
standard library are built. There are a couple ways to resolve this problem:
1. Refactor so that the errors to not need to carry source locations.
2. Refactor to avoid using `Error` (the code using these errors would not
require `Sendable` if it were not for `Error`'s inherent `Sendable`
requirement).
3. Suppress the warnings with a `@uncheck Sendable` wrapper.
Option 1 probably requires significant refactoring and option 2 seems
undesirable since it means that the implementation must forgo the convenience
of Swift's error handling model. Therefore this PR implements option 3 as the
most expedient way to stop the diagnostic spam, leaving improvement on the
status quo as a future exercise.1 parent dc95688 commit 69fa54d
File tree
2 files changed
+29
-3
lines changed- Sources/_RegexParser/Regex/Parse
2 files changed
+29
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | | - | |
| 23 | + | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
23 | 33 | | |
24 | 34 | | |
25 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
| |||
81 | 95 | | |
82 | 96 | | |
83 | 97 | | |
| 98 | + | |
| 99 | + | |
84 | 100 | | |
85 | | - | |
| 101 | + | |
86 | 102 | | |
87 | 103 | | |
88 | 104 | | |
89 | | - | |
| 105 | + | |
90 | 106 | | |
91 | 107 | | |
92 | 108 | | |
| |||
0 commit comments