Skip to content

Commit d7a25a7

Browse files
committed
Rename _startCachingForThrownErrors since it shows up in backtraces, make it clearer what it's there for
1 parent d013a09 commit d7a25a7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/Testing/SourceAttribution/Backtrace.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ extension Backtrace {
322322

323323
/// The implementation of ``Backtrace/startCachingForThrownErrors()``, run
324324
/// only once.
325-
private static let _startCachingForThrownErrors: Void = {
325+
///
326+
/// This value is named oddly so that it shows up clearly in symbolicated
327+
/// backtraces.
328+
private static let __SWIFT_TESTING_IS_CAPTURING_A_BACKTRACE_FOR_A_THROWN_ERROR__: Void = {
326329
_oldWillThrowHandler.withLock { oldWillThrowHandler in
327330
oldWillThrowHandler = swt_setWillThrowHandler { errorAddress in
328331
let backtrace = Backtrace.current()
@@ -346,7 +349,7 @@ extension Backtrace {
346349
/// developer-supplied code to ensure that thrown errors' backtraces are
347350
/// always captured.
348351
static func startCachingForThrownErrors() {
349-
_startCachingForThrownErrors
352+
__SWIFT_TESTING_IS_CAPTURING_A_BACKTRACE_FOR_A_THROWN_ERROR__
350353
}
351354

352355
/// Flush stale entries from the error-mapping cache.

0 commit comments

Comments
 (0)