@@ -175,20 +175,19 @@ static LifetimeDependenceKind getLifetimeDependenceKindFromDecl(
175175 : LifetimeDependenceKind::Inherit;
176176}
177177
178- static bool isBitwiseCopyable (Type type, ModuleDecl *mod, ASTContext &ctx) {
178+ static bool isBitwiseCopyable (Type type, ASTContext &ctx) {
179179 auto *bitwiseCopyableProtocol =
180180 ctx.getProtocol (KnownProtocolKind::BitwiseCopyable);
181181 if (!bitwiseCopyableProtocol) {
182182 return false ;
183183 }
184- return (bool )(mod-> checkConformance (type, bitwiseCopyableProtocol));
184+ return (bool )(ModuleDecl:: checkConformance (type, bitwiseCopyableProtocol));
185185}
186186
187187std::optional<LifetimeDependenceInfo>
188188LifetimeDependenceInfo::fromTypeRepr (AbstractFunctionDecl *afd) {
189189 auto *dc = afd->getDeclContext ();
190190 auto &ctx = dc->getASTContext ();
191- auto *mod = afd->getModuleContext ();
192191 auto &diags = ctx.Diags ;
193192 auto capacity = afd->hasImplicitSelfDecl ()
194193 ? (afd->getParameters ()->size () + 1 )
@@ -216,7 +215,7 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd) {
216215 bool isCompatible = true ;
217216 // Lifetime dependence always propagates through temporary BitwiseCopyable
218217 // values, even if the dependence is scoped.
219- if (!isBitwiseCopyable (paramType, mod, ctx)) {
218+ if (!isBitwiseCopyable (paramType, ctx)) {
220219 isCompatible = isLifetimeDependenceCompatibleWithOwnership (
221220 lifetimeKind, ownership, afd);
222221 }
@@ -416,7 +415,6 @@ std::optional<LifetimeDependenceInfo>
416415LifetimeDependenceInfo::infer (AbstractFunctionDecl *afd) {
417416 auto *dc = afd->getDeclContext ();
418417 auto &ctx = dc->getASTContext ();
419- auto *mod = afd->getModuleContext ();
420418
421419 if (!ctx.LangOpts .hasFeature (Feature::NonescapableTypes)) {
422420 return std::nullopt ;
@@ -450,7 +448,7 @@ LifetimeDependenceInfo::infer(AbstractFunctionDecl *afd) {
450448 if (!cd && afd->hasImplicitSelfDecl ()) {
451449 Type selfTypeInContext = dc->getSelfTypeInContext ();
452450 if (selfTypeInContext->isEscapable ()) {
453- if (isBitwiseCopyable (selfTypeInContext, mod, ctx)) {
451+ if (isBitwiseCopyable (selfTypeInContext, ctx)) {
454452 diags.diagnose (
455453 returnLoc,
456454 diag::lifetime_dependence_method_escapable_bitwisecopyable_self);
@@ -483,7 +481,7 @@ LifetimeDependenceInfo::infer(AbstractFunctionDecl *afd) {
483481 }
484482 auto paramOwnership = param->getValueOwnership ();
485483 if (paramTypeInContext->isEscapable ()) {
486- if (isBitwiseCopyable (paramTypeInContext, mod, ctx)) {
484+ if (isBitwiseCopyable (paramTypeInContext, ctx)) {
487485 continue ;
488486 }
489487 if (paramOwnership == ValueOwnership::Default) {
0 commit comments