@@ -2039,10 +2039,8 @@ namespace {
20392039 if (Impl.SwiftContext .LangOpts .hasFeature (Feature::LifetimeDependence)) {
20402040 fd->getAttrs ().add (new (Impl.SwiftContext )
20412041 UnsafeNonEscapableResultAttr (/* Implicit=*/ true ));
2042- if (Impl.SwiftContext .LangOpts .hasFeature (
2043- Feature::StrictMemorySafety))
2044- fd->getAttrs ().add (new (Impl.SwiftContext )
2045- UnsafeAttr (/* Implicit=*/ true ));
2042+ fd->getAttrs ().add (new (Impl.SwiftContext )
2043+ UnsafeAttr (/* Implicit=*/ true ));
20462044 }
20472045 }
20482046
@@ -4179,19 +4177,19 @@ namespace {
41794177 LifetimeDependenceInfoRequest{result},
41804178 Impl.SwiftContext .AllocateCopy (lifetimeDependencies));
41814179 }
4182- if (ASTContext.LangOpts .hasFeature (Feature::StrictMemorySafety)) {
4183- for (auto [idx, param] : llvm::enumerate (decl->parameters ())) {
4184- if (swiftParams->get (idx)->getInterfaceType ()->isEscapable ())
4185- continue ;
4186- if (param->hasAttr <clang::NoEscapeAttr>() || paramHasAnnotation[idx])
4187- continue ;
4188- // We have a nonescapable parameter that does not have its lifetime
4189- // annotated nor is it marked noescape.
4190- auto attr = new (ASTContext) UnsafeAttr (/* implicit=*/ true );
4191- result->getAttrs ().add (attr);
4192- break ;
4193- }
4180+
4181+ for (auto [idx, param] : llvm::enumerate (decl->parameters ())) {
4182+ if (swiftParams->get (idx)->getInterfaceType ()->isEscapable ())
4183+ continue ;
4184+ if (param->hasAttr <clang::NoEscapeAttr>() || paramHasAnnotation[idx])
4185+ continue ;
4186+ // We have a nonescapable parameter that does not have its lifetime
4187+ // annotated nor is it marked noescape.
4188+ auto attr = new (ASTContext) UnsafeAttr (/* implicit=*/ true );
4189+ result->getAttrs ().add (attr);
4190+ break ;
41944191 }
4192+
41954193 Impl.diagnoseTargetDirectly (decl);
41964194 }
41974195
0 commit comments