diff --git a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift index 5dca064e5d3..a3f57be2621 100644 --- a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift @@ -466,7 +466,6 @@ public let DECL_NODES: [Node] = [ .keyword(.private), .keyword(.public), .keyword(.reasync), - .keyword(._resultDependsOnSelf), .keyword(.required), .keyword(.static), .keyword(.transferring), diff --git a/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift b/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift index 9b3ec7292d0..06f30bd3784 100644 --- a/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift +++ b/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift @@ -253,8 +253,6 @@ public enum Keyword: CaseIterable { case renamed case `repeat` case required - case _resultDependsOn - case _resultDependsOnSelf case `rethrows` case retroactive case `return` @@ -643,10 +641,6 @@ public enum Keyword: CaseIterable { return KeywordSpec("repeat", isLexerClassified: true) case .required: return KeywordSpec("required") - case ._resultDependsOn: - return KeywordSpec("_resultDependsOn", experimentalFeature: .nonescapableTypes) - case ._resultDependsOnSelf: - return KeywordSpec("_resultDependsOnSelf", experimentalFeature: .nonescapableTypes) case .rethrows: return KeywordSpec("rethrows", isLexerClassified: true) case .retroactive: diff --git a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift index 93a0740043d..87354aeaaaf 100644 --- a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift @@ -592,7 +592,6 @@ public let TYPE_NODES: [Node] = [ .keyword(.borrowing), .keyword(.consuming), .keyword(.transferring), - .keyword(._resultDependsOn), .keyword(.sending), ]), documentation: "The specifier token that's attached to the type." diff --git a/Sources/SwiftParser/Declarations.swift b/Sources/SwiftParser/Declarations.swift index 240e8661a2b..0fc05cc60e1 100644 --- a/Sources/SwiftParser/Declarations.swift +++ b/Sources/SwiftParser/Declarations.swift @@ -22,7 +22,7 @@ extension DeclarationModifier { case .__consuming, .__setter_access, ._const, ._local, .async, .borrowing, .class, .consuming, .convenience, .distributed, .dynamic, .final, .indirect, .infix, .isolated, .lazy, .mutating, .nonmutating, - .optional, .override, .postfix, .prefix, .reasync, ._resultDependsOn, ._resultDependsOnSelf, .required, + .optional, .override, .postfix, .prefix, .reasync, .required, .rethrows, .static, .weak, .transferring, .sending: return false case .fileprivate, .internal, .nonisolated, .package, .open, .private, diff --git a/Sources/SwiftParser/Modifiers.swift b/Sources/SwiftParser/Modifiers.swift index 9f29fae0b5a..d53c4d3b95d 100644 --- a/Sources/SwiftParser/Modifiers.swift +++ b/Sources/SwiftParser/Modifiers.swift @@ -89,8 +89,7 @@ extension Parser { (.declarationModifier(._const), let handle)?, (.declarationModifier(._local), let handle)?, (.declarationModifier(.__setter_access), let handle)?, - (.declarationModifier(.reasync), let handle)?, - (.declarationModifier(._resultDependsOnSelf), let handle)? + (.declarationModifier(.reasync), let handle)? where experimentalFeatures.contains(.nonescapableTypes): let (unexpectedBeforeKeyword, keyword) = self.eat(handle) elements.append(RawDeclModifierSyntax(unexpectedBeforeKeyword, name: keyword, detail: nil, arena: self.arena)) diff --git a/Sources/SwiftParser/Patterns.swift b/Sources/SwiftParser/Patterns.swift index 1adb1c095e6..45e2db3106f 100644 --- a/Sources/SwiftParser/Patterns.swift +++ b/Sources/SwiftParser/Patterns.swift @@ -379,7 +379,6 @@ extension Parser.Lookahead { && !self.at(.keyword(.consuming)) && !(experimentalFeatures.contains(.transferringArgsAndResults) && self.at(.keyword(.transferring))) && !(experimentalFeatures.contains(.sendingArgsAndResults) && self.at(.keyword(.sending))) - && !(experimentalFeatures.contains(.nonescapableTypes) && self.at(.keyword(._resultDependsOn))) { return true } diff --git a/Sources/SwiftParser/TokenPrecedence.swift b/Sources/SwiftParser/TokenPrecedence.swift index fa80dc81a31..dd77a5a64a2 100644 --- a/Sources/SwiftParser/TokenPrecedence.swift +++ b/Sources/SwiftParser/TokenPrecedence.swift @@ -235,8 +235,7 @@ enum TokenPrecedence: Comparable { .__consuming, .final, .required, .optional, .lazy, .dynamic, .infix, .postfix, .prefix, .mutating, .nonmutating, .convenience, .override, .package, .open, .__setter_access, .indirect, .isolated, .nonisolated, .distributed, ._local, - .inout, ._mutating, ._borrow, ._borrowing, .borrowing, ._consuming, .consuming, .consume, ._resultDependsOnSelf, - ._resultDependsOn, + .inout, ._mutating, ._borrow, ._borrowing, .borrowing, ._consuming, .consuming, .consume, .transferring, .dependsOn, .scoped, .sending, // Accessors .get, .set, .didSet, .willSet, .unsafeAddress, .addressWithOwner, .addressWithNativeOwner, .unsafeMutableAddress, diff --git a/Sources/SwiftParser/TokenSpecSet.swift b/Sources/SwiftParser/TokenSpecSet.swift index 694cb5f8ae8..cdc11778df0 100644 --- a/Sources/SwiftParser/TokenSpecSet.swift +++ b/Sources/SwiftParser/TokenSpecSet.swift @@ -382,8 +382,6 @@ enum DeclarationModifier: TokenSpecSet { case transferring case unowned case weak - case _resultDependsOn - case _resultDependsOnSelf init?(lexeme: Lexer.Lexeme, experimentalFeatures: Parser.ExperimentalFeatures) { switch PrepareForKeywordMatch(lexeme) { @@ -424,9 +422,6 @@ enum DeclarationModifier: TokenSpecSet { case TokenSpec(.sending): self = .sending case TokenSpec(.unowned): self = .unowned case TokenSpec(.weak): self = .weak - case TokenSpec(._resultDependsOn) where experimentalFeatures.contains(.nonescapableTypes): self = ._resultDependsOn - case TokenSpec(._resultDependsOnSelf) where experimentalFeatures.contains(.nonescapableTypes): - self = ._resultDependsOnSelf default: return nil } } @@ -470,8 +465,6 @@ enum DeclarationModifier: TokenSpecSet { case .sending: return .keyword(.sending) case .unowned: return TokenSpec(.unowned, recoveryPrecedence: .declKeyword) case .weak: return TokenSpec(.weak, recoveryPrecedence: .declKeyword) - case ._resultDependsOn: return TokenSpec(._resultDependsOn, recoveryPrecedence: .declKeyword) - case ._resultDependsOnSelf: return TokenSpec(._resultDependsOnSelf, recoveryPrecedence: .declKeyword) } } } diff --git a/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift b/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift index b23408afece..9c5ce1ef7bb 100644 --- a/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift +++ b/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift @@ -802,10 +802,6 @@ extension DeclModifierSyntax { case `private` case `public` case reasync - #if compiler(>=5.8) - @_spi(ExperimentalLanguageFeatures) - #endif - case _resultDependsOnSelf case required case `static` #if compiler(>=5.8) @@ -883,8 +879,6 @@ extension DeclModifierSyntax { self = .public case TokenSpec(.reasync): self = .reasync - case TokenSpec(._resultDependsOnSelf) where experimentalFeatures.contains(.nonescapableTypes): - self = ._resultDependsOnSelf case TokenSpec(.required): self = .required case TokenSpec(.static): @@ -966,8 +960,6 @@ extension DeclModifierSyntax { self = .public case TokenSpec(.reasync): self = .reasync - case TokenSpec(._resultDependsOnSelf): - self = ._resultDependsOnSelf case TokenSpec(.required): self = .required case TokenSpec(.static): @@ -1049,8 +1041,6 @@ extension DeclModifierSyntax { return .keyword(.public) case .reasync: return .keyword(.reasync) - case ._resultDependsOnSelf: - return .keyword(._resultDependsOnSelf) case .required: return .keyword(.required) case .static: @@ -1134,8 +1124,6 @@ extension DeclModifierSyntax { return .keyword(.public) case .reasync: return .keyword(.reasync) - case ._resultDependsOnSelf: - return .keyword(._resultDependsOnSelf) case .required: return .keyword(.required) case .static: @@ -3358,10 +3346,6 @@ extension SimpleTypeSpecifierSyntax { #if compiler(>=5.8) @_spi(ExperimentalLanguageFeatures) #endif - case _resultDependsOn - #if compiler(>=5.8) - @_spi(ExperimentalLanguageFeatures) - #endif case sending init?(lexeme: Lexer.Lexeme, experimentalFeatures: Parser.ExperimentalFeatures) { @@ -3382,8 +3366,6 @@ extension SimpleTypeSpecifierSyntax { self = .consuming case TokenSpec(.transferring) where experimentalFeatures.contains(.transferringArgsAndResults): self = .transferring - case TokenSpec(._resultDependsOn) where experimentalFeatures.contains(.nonescapableTypes): - self = ._resultDependsOn case TokenSpec(.sending) where experimentalFeatures.contains(.sendingArgsAndResults): self = .sending default: @@ -3409,8 +3391,6 @@ extension SimpleTypeSpecifierSyntax { self = .consuming case TokenSpec(.transferring): self = .transferring - case TokenSpec(._resultDependsOn): - self = ._resultDependsOn case TokenSpec(.sending): self = .sending default: @@ -3436,8 +3416,6 @@ extension SimpleTypeSpecifierSyntax { return .keyword(.consuming) case .transferring: return .keyword(.transferring) - case ._resultDependsOn: - return .keyword(._resultDependsOn) case .sending: return .keyword(.sending) } @@ -3465,8 +3443,6 @@ extension SimpleTypeSpecifierSyntax { return .keyword(.consuming) case .transferring: return .keyword(.transferring) - case ._resultDependsOn: - return .keyword(._resultDependsOn) case .sending: return .keyword(.sending) } diff --git a/Sources/SwiftSyntax/generated/Keyword.swift b/Sources/SwiftSyntax/generated/Keyword.swift index e0bde33ba27..96f5d94410c 100644 --- a/Sources/SwiftSyntax/generated/Keyword.swift +++ b/Sources/SwiftSyntax/generated/Keyword.swift @@ -192,14 +192,6 @@ public enum Keyword: UInt8, Hashable, Sendable { case renamed case `repeat` case required - #if compiler(>=5.8) - @_spi(ExperimentalLanguageFeatures) - #endif - case _resultDependsOn - #if compiler(>=5.8) - @_spi(ExperimentalLanguageFeatures) - #endif - case _resultDependsOnSelf case `rethrows` case retroactive case `return` @@ -733,8 +725,6 @@ public enum Keyword: UInt8, Hashable, Sendable { self = ._objcRuntimeName case "addressWithOwner": self = .addressWithOwner - case "_resultDependsOn": - self = ._resultDependsOn default: return nil } @@ -771,8 +761,6 @@ public enum Keyword: UInt8, Hashable, Sendable { self = ._compilerInitialized case "_originallyDefinedIn": self = ._originallyDefinedIn - case "_resultDependsOnSelf": - self = ._resultDependsOnSelf case "unsafeMutableAddress": self = .unsafeMutableAddress default: @@ -998,8 +986,6 @@ public enum Keyword: UInt8, Hashable, Sendable { "renamed", "repeat", "required", - "_resultDependsOn", - "_resultDependsOnSelf", "rethrows", "retroactive", "return", diff --git a/Sources/SwiftSyntax/generated/raw/RawSyntaxValidation.swift b/Sources/SwiftSyntax/generated/raw/RawSyntaxValidation.swift index a89af563bba..b98c190d2a1 100644 --- a/Sources/SwiftSyntax/generated/raw/RawSyntaxValidation.swift +++ b/Sources/SwiftSyntax/generated/raw/RawSyntaxValidation.swift @@ -794,7 +794,6 @@ func validateLayout(layout: RawSyntaxBuffer, as kind: SyntaxKind) { .keyword("private"), .keyword("public"), .keyword("reasync"), - .keyword("_resultDependsOnSelf"), .keyword("required"), .keyword("static"), .keyword("transferring"), @@ -2299,7 +2298,6 @@ func validateLayout(layout: RawSyntaxBuffer, as kind: SyntaxKind) { .keyword("borrowing"), .keyword("consuming"), .keyword("transferring"), - .keyword("_resultDependsOn"), .keyword("sending") ])) assertNoError(kind, 2, verify(layout[2], as: RawUnexpectedNodesSyntax?.self)) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index 1a407a0fdb1..a40573da17d 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -169,7 +169,7 @@ public struct DeclModifierDetailSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn /// ### Children /// -/// - `name`: (`__consuming` | `__setter_access` | `_const` | `_local` | `actor` | `async` | `borrowing` | `class` | `consuming` | `convenience` | `distributed` | `dynamic` | `fileprivate` | `final` | `indirect` | `infix` | `internal` | `isolated` | `lazy` | `mutating` | `nonisolated` | `nonmutating` | `open` | `optional` | `override` | `package` | `postfix` | `prefix` | `private` | `public` | `reasync` | `_resultDependsOnSelf` | `required` | `static` | `transferring` | `unowned` | `weak` | `sending`) +/// - `name`: (`__consuming` | `__setter_access` | `_const` | `_local` | `actor` | `async` | `borrowing` | `class` | `consuming` | `convenience` | `distributed` | `dynamic` | `fileprivate` | `final` | `indirect` | `infix` | `internal` | `isolated` | `lazy` | `mutating` | `nonisolated` | `nonmutating` | `open` | `optional` | `override` | `package` | `postfix` | `prefix` | `private` | `public` | `reasync` | `required` | `static` | `transferring` | `unowned` | `weak` | `sending`) /// - `detail`: ``DeclModifierDetailSyntax``? /// /// ### Contained in @@ -270,7 +270,6 @@ public struct DeclModifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod /// - `private` /// - `public` /// - `reasync` - /// - `_resultDependsOnSelf` /// - `required` /// - `static` /// - `transferring` diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index 1a9479daec9..edeb9451c43 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -1090,7 +1090,7 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, /// /// ### Children /// -/// - `specifier`: (`inout` | `__shared` | `__owned` | `isolated` | `_const` | `borrowing` | `consuming` | `transferring` | `_resultDependsOn` | `sending`) +/// - `specifier`: (`inout` | `__shared` | `__owned` | `isolated` | `_const` | `borrowing` | `consuming` | `transferring` | `sending`) /// /// ### Contained in /// @@ -1155,7 +1155,6 @@ public struct SimpleTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy /// - `borrowing` /// - `consuming` /// - `transferring` - /// - `_resultDependsOn` /// - `sending` public var specifier: TokenSyntax { get { diff --git a/Tests/SwiftParserTest/DeclarationTests.swift b/Tests/SwiftParserTest/DeclarationTests.swift index 2ffe015603d..92582224963 100644 --- a/Tests/SwiftParserTest/DeclarationTests.swift +++ b/Tests/SwiftParserTest/DeclarationTests.swift @@ -3225,52 +3225,6 @@ final class DeclarationTests: ParserTestCase { ) } - func testResultDependsOnSelf() { - assertParse( - """ - class MethodModifiers { - _resultDependsOnSelf func getDependentResult() -> Builtin.NativeObject { - return Builtin.unsafeCastToNativeObject(self) - } - } - """, - experimentalFeatures: .nonescapableTypes - ) - - assertParse( - """ - class MethodModifiers { - _resultDependsOnSelf func _resultDependsOnSelf() -> Builtin.NativeObject { - return Builtin.unsafeCastToNativeObject(self) - } - } - """, - experimentalFeatures: .nonescapableTypes - ) - } - - func testResultDependsOn() { - assertParse( - """ - class Klass {} - func testTypeSpecifier(x : _resultDependsOn Klass) -> Builtin.NativeObject { - return Builtin.unsafeCastToNativeObject(x) - } - """, - experimentalFeatures: .nonescapableTypes - ) - - assertParse( - """ - class Klass {} - func testMultipleTypeSpecifier(x : _resultDependsOn Klass, y : _resultDependsOn Klass) -> (Builtin.NativeObject, Builtin.NativeObject) { - return (Builtin.unsafeCastToNativeObject(x), Builtin.unsafeCastToNativeObject(x)) - } - """, - experimentalFeatures: .nonescapableTypes - ) - } - func testDeclarationEndingWithNewline() { let inputs: [UInt: String] = [ #line: "var x = 0\n",