Skip to content

Commit 6611153

Browse files
committed
[Runtime] Change the unowned reference fatal error to "was already destroyed."
The "was already deallocated" message is incorrect, since the target of an unowned reference stays allocated even after being deinitialized. We could say "was already deinitialized" but that's a bit of a niche term. "Was already destroyed" conveys what happened without the reader needing to worry about deinitialization versus deallocation. rdar://149237704
1 parent f7bf701 commit 6611153

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Errors.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,11 @@ void swift::swift_abortRetainUnowned(const void *object) {
506506
if (object) {
507507
swift::fatalError(FatalErrorFlags::ReportBacktrace,
508508
"Fatal error: Attempted to read an unowned reference but "
509-
"object %p was already deallocated\n", object);
509+
"object %p was already destroyed\n", object);
510510
} else {
511511
swift::fatalError(FatalErrorFlags::ReportBacktrace,
512512
"Fatal error: Attempted to read an unowned reference but "
513-
"the object was already deallocated\n");
513+
"the object was already destroyed\n");
514514
}
515515
}
516516

0 commit comments

Comments
 (0)