Fix a lifetime dependence diagnostic

`LifetimeDescriptor::getName()` can crash if the descriptor had a `self`.
Replace with `LifetimeDescriptor::getString()`
This commit is contained in:
Meghana Gupta
2025-07-03 15:20:04 -07:00
parent de6870ed35
commit 6d0a6d2760
3 changed files with 16 additions and 3 deletions

View File

@@ -880,7 +880,7 @@ protected:
if (!targetDeclAndIndex->first->isInOut()) {
diagnose(targetDeclAndIndex->first,
diag::lifetime_parameter_requires_inout,
targetDescriptor->getName());
targetDescriptor->getString());
}
targetIndex = targetDeclAndIndex->second;
} else {