Skip to content

Commit 979334e

Browse files
authored
Merge pull request #70459 from atrick/rename-nonescapable
Rename NonesapableTypes feature
2 parents b4a3fbe + ace9937 commit 979334e

21 files changed

+29
-29
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ ERROR(storage_restrictions_attr_expected_name,none,
21622162

21632163
ERROR(requires_non_escapable_types, none,
21642164
"'%0' %select{attribute|parameter specifier}1 is only valid when experimental "
2165-
"NonEscapableTypes is enabled",
2165+
"NonescapableTypes is enabled",
21662166
(StringRef, bool))
21672167

21682168
#define UNDEFINE_DIAGNOSTIC_MACROS

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7604,7 +7604,7 @@ NOTE(add_explicit_protocol_for_conformance,none,
76047604
"consider making %kind0 explicitly conform to the '%1' protocol",
76057605
(const ValueDecl *, StringRef))
76067606
ERROR(escapable_requires_feature_flag,none,
7607-
"type '~Escapable' requires -enable-experimental-feature NonEscapableTypes",
7607+
"type '~Escapable' requires -enable-experimental-feature NonescapableTypes",
76087608
())
76097609

76107610
// -- older ones below --
@@ -7699,7 +7699,7 @@ ERROR(noncopyable_cannot_have_read_set_accessor,none,
76997699
(unsigned))
77007700

77017701
ERROR(nonescapable_types_attr_disabled,none,
7702-
"attribute requires '-enable-experimental-feature NonEscapableTypes'", ())
7702+
"attribute requires '-enable-experimental-feature NonescapableTypes'", ())
77037703

77047704
//------------------------------------------------------------------------------
77057705
// MARK: Init accessors

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ EXPERIMENTAL_FEATURE(StructLetDestructuring, true)
257257

258258
/// Enable non-escapable type attributes and function attributes that support
259259
/// lifetime-dependent results.
260-
EXPERIMENTAL_FEATURE(NonEscapableTypes, false)
260+
EXPERIMENTAL_FEATURE(NonescapableTypes, false)
261261

262262
/// Enable the `@_extern` attribute.
263263
EXPERIMENTAL_FEATURE(Extern, true)

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3752,7 +3752,7 @@ static bool usesFeatureStructLetDestructuring(Decl *decl) {
37523752
return false;
37533753
}
37543754

3755-
static bool usesFeatureNonEscapableTypes(Decl *decl) {
3755+
static bool usesFeatureNonescapableTypes(Decl *decl) {
37563756
if (decl->getAttrs().hasAttribute<NonEscapableAttr>() ||
37573757
decl->getAttrs().hasAttribute<UnsafeNonEscapableResultAttr>()) {
37583758
return true;

lib/ASTGen/Sources/ASTGen/SourceFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension Parser.ExperimentalFeatures {
5454
mapFeature(.ThenStatements, to: .thenStatements)
5555
mapFeature(.TypedThrows, to: .typedThrows)
5656
mapFeature(.DoExpressions, to: .doExpressions)
57-
mapFeature(.NonEscapableTypes, to: .nonEscapableTypes)
57+
mapFeature(.NonescapableTypes, to: .nonescapableTypes)
5858
}
5959
}
6060

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
28722872
}
28732873

28742874
if (DK == DAK_ResultDependsOnSelf &&
2875-
!Context.LangOpts.hasFeature(Feature::NonEscapableTypes)) {
2875+
!Context.LangOpts.hasFeature(Feature::NonescapableTypes)) {
28762876
diagnose(Loc, diag::requires_non_escapable_types, AttrName, true);
28772877
DiscardAttribute = true;
28782878
}
@@ -5160,7 +5160,7 @@ ParserStatus Parser::parseTypeAttributeListPresent(
51605160
}
51615161

51625162
if (Tok.isContextualKeyword("_resultDependsOn")) {
5163-
if (!Context.LangOpts.hasFeature(Feature::NonEscapableTypes)) {
5163+
if (!Context.LangOpts.hasFeature(Feature::NonescapableTypes)) {
51645164
diagnose(Tok, diag::requires_non_escapable_types, "resultDependsOn",
51655165
false);
51665166
}

lib/Parse/ParsePattern.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ bool Parser::startsParameterName(bool isClosure) {
140140
!Tok.isContextualKeyword("__owned") &&
141141
!Tok.isContextualKeyword("borrowing") &&
142142
!Tok.isContextualKeyword("consuming") && !Tok.is(tok::kw_repeat) &&
143-
(!Context.LangOpts.hasFeature(Feature::NonEscapableTypes) ||
143+
(!Context.LangOpts.hasFeature(Feature::NonescapableTypes) ||
144144
!Tok.isContextualKeyword("_resultDependsOn")))
145145
return true;
146146

@@ -235,7 +235,7 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
235235
Tok.isContextualKeyword("consuming") ||
236236
Tok.isContextualKeyword("isolated") ||
237237
Tok.isContextualKeyword("_const") ||
238-
(Context.LangOpts.hasFeature(Feature::NonEscapableTypes) &&
238+
(Context.LangOpts.hasFeature(Feature::NonescapableTypes) &&
239239
Tok.isContextualKeyword("_resultDependsOn"))))) {
240240
// is this token the identifier of an argument label? `inout` is a
241241
// reserved keyword but the other modifiers are not.

lib/Parse/ParseType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ ParserResult<TypeRepr> Parser::parseTypeSimple(
162162
Tok.getRawText().equals("__owned") ||
163163
Tok.getRawText().equals("consuming") ||
164164
Tok.getRawText().equals("borrowing") ||
165-
(Context.LangOpts.hasFeature(Feature::NonEscapableTypes) &&
165+
(Context.LangOpts.hasFeature(Feature::NonescapableTypes) &&
166166
Tok.getRawText().equals("resultDependsOn"))))) {
167167
// Type specifier should already be parsed before here. This only happens
168168
// for construct like 'P1 & inout P2'.

lib/Sema/TypeCheckAttr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7288,14 +7288,14 @@ void AttributeChecker::visitRawLayoutAttr(RawLayoutAttr *attr) {
72887288
}
72897289

72907290
void AttributeChecker::visitNonEscapableAttr(NonEscapableAttr *attr) {
7291-
if (!Ctx.LangOpts.hasFeature(Feature::NonEscapableTypes)) {
7291+
if (!Ctx.LangOpts.hasFeature(Feature::NonescapableTypes)) {
72927292
diagnoseAndRemoveAttr(attr, diag::nonescapable_types_attr_disabled);
72937293
}
72947294
}
72957295

72967296
void AttributeChecker::visitUnsafeNonEscapableResultAttr(
72977297
UnsafeNonEscapableResultAttr *attr) {
7298-
if (!Ctx.LangOpts.hasFeature(Feature::NonEscapableTypes)) {
7298+
if (!Ctx.LangOpts.hasFeature(Feature::NonescapableTypes)) {
72997299
diagnoseAndRemoveAttr(attr, diag::nonescapable_types_attr_disabled);
73007300
}
73017301
}

lib/Sema/TypeCheckType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5197,7 +5197,7 @@ NeverNullType TypeResolver::resolveInverseType(InverseTypeRepr *repr,
51975197

51985198
// Gate the '~Escapable' type behind a specific flag for now.
51995199
if (*kind == InvertibleProtocolKind::Escapable &&
5200-
!getASTContext().LangOpts.hasFeature(Feature::NonEscapableTypes)) {
5200+
!getASTContext().LangOpts.hasFeature(Feature::NonescapableTypes)) {
52015201
diagnoseInvalid(repr, repr->getLoc(),
52025202
diag::escapable_requires_feature_flag);
52035203
return ErrorType::get(getASTContext());

0 commit comments

Comments
 (0)