Skip to content

Commit 5f003fd

Browse files
authored
Merge pull request #71869 from meg-gupta/builtininference
Turn off lifetime dependence inference on builtins temporarily
2 parents 32c305f + 149e879 commit 5f003fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/Sema/LifetimeDependence.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,15 @@ LifetimeDependenceInfo::infer(AbstractFunctionDecl *afd, Type resultType) {
360360
return std::nullopt;
361361
}
362362
if (!candidateParam && !hasParamError) {
363+
// Explicitly turn off error messages for builtins, since some of are
364+
// ~Escapable currently.
365+
// TODO: rdar://123555720: Remove this check after another round of
366+
// surveying builtins
367+
if (auto *fd = dyn_cast<FuncDecl>(afd)) {
368+
if (fd->isImplicit()) {
369+
return std::nullopt;
370+
}
371+
}
363372
diags.diagnose(returnLoc,
364373
diag::lifetime_dependence_cannot_infer_no_candidates);
365374
return std::nullopt;

0 commit comments

Comments
 (0)