|
38 | 38 | /// fails. The default is the line number where `assert(_:_:file:line:)` |
39 | 39 | /// is called. |
40 | 40 | @_transparent |
41 | | -@_unavailableInEmbedded |
42 | 41 | #if $Embedded |
43 | 42 | @_disfavoredOverload |
44 | 43 | #endif |
@@ -101,7 +100,6 @@ public func assert( |
101 | 100 | /// fails. The default is the line number where |
102 | 101 | /// `precondition(_:_:file:line:)` is called. |
103 | 102 | @_transparent |
104 | | -@_unavailableInEmbedded |
105 | 103 | #if $Embedded |
106 | 104 | @_disfavoredOverload |
107 | 105 | #endif |
@@ -167,7 +165,6 @@ public func precondition( |
167 | 165 | /// line number where `assertionFailure(_:file:line:)` is called. |
168 | 166 | @inlinable |
169 | 167 | @inline(__always) |
170 | | -@_unavailableInEmbedded |
171 | 168 | #if $Embedded |
172 | 169 | @_disfavoredOverload |
173 | 170 | #endif |
@@ -229,7 +226,6 @@ public func assertionFailure( |
229 | 226 | /// - line: The line number to print along with `message`. The default is the |
230 | 227 | /// line number where `preconditionFailure(_:file:line:)` is called. |
231 | 228 | @_transparent |
232 | | -@_unavailableInEmbedded |
233 | 229 | #if $Embedded |
234 | 230 | @_disfavoredOverload |
235 | 231 | #endif |
@@ -275,16 +271,26 @@ public func preconditionFailure( |
275 | 271 | /// - line: The line number to print along with `message`. The default is the |
276 | 272 | /// line number where `fatalError(_:file:line:)` is called. |
277 | 273 | @_transparent |
278 | | -@_unavailableInEmbedded |
279 | 274 | #if $Embedded |
280 | 275 | @_disfavoredOverload |
281 | 276 | #endif |
282 | 277 | public func fatalError( |
283 | 278 | _ message: @autoclosure () -> String = String(), |
284 | 279 | file: StaticString = #file, line: UInt = #line |
285 | 280 | ) -> Never { |
| 281 | +#if !$Embedded |
286 | 282 | _assertionFailure("Fatal error", message(), file: file, line: line, |
287 | 283 | flags: _fatalErrorFlags()) |
| 284 | +#else |
| 285 | + if _isDebugAssertConfiguration() { |
| 286 | + _assertionFailure("Fatal error", message(), file: file, line: line, |
| 287 | + flags: _fatalErrorFlags()) |
| 288 | + } else { |
| 289 | + Builtin.condfail_message(true._value, |
| 290 | + StaticString("fatal error").unsafeRawPointer) |
| 291 | + Builtin.unreachable() |
| 292 | + } |
| 293 | +#endif |
288 | 294 | } |
289 | 295 |
|
290 | 296 | #if $Embedded |
|
0 commit comments