From f832ba220a6d1040a0c29c9d23f2c2c8f14dd0ce Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 8 Feb 2024 10:06:48 -0800 Subject: [PATCH] Pass on the `BorrowingSwitch` feature flag to the SwiftSyntax parser. And remove the `-disable-experimental-parser-round-trip` flag from borrowing switch tests now that the SwiftSyntax parser supports them with https://github.com/apple/swift-syntax/pull/2487. --- lib/ASTGen/Sources/ASTGen/SourceFile.swift | 1 + test/SILGen/borrowing_switch_subjects.swift | 2 +- test/SILOptimizer/moveonly_borrowing_switch.swift | 2 +- .../moveonly_borrowing_switch_copyable_subpattern.swift | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ASTGen/Sources/ASTGen/SourceFile.swift b/lib/ASTGen/Sources/ASTGen/SourceFile.swift index 7dd2bb67e3cfa..93b91d40205b2 100644 --- a/lib/ASTGen/Sources/ASTGen/SourceFile.swift +++ b/lib/ASTGen/Sources/ASTGen/SourceFile.swift @@ -60,6 +60,7 @@ extension Parser.ExperimentalFeatures { mapFeature(.DoExpressions, to: .doExpressions) mapFeature(.NonescapableTypes, to: .nonescapableTypes) mapFeature(.TransferringArgsAndResults, to: .transferringArgsAndResults) + mapFeature(.BorrowingSwitch, to: .borrowingSwitch) } } diff --git a/test/SILGen/borrowing_switch_subjects.swift b/test/SILGen/borrowing_switch_subjects.swift index 6b677fee251b3..c87921987d11f 100644 --- a/test/SILGen/borrowing_switch_subjects.swift +++ b/test/SILGen/borrowing_switch_subjects.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-emit-silgen -enable-experimental-feature BorrowingSwitch -disable-experimental-parser-round-trip %s | %FileCheck %s +// RUN: %target-swift-emit-silgen -enable-experimental-feature BorrowingSwitch %s | %FileCheck %s struct Inner: ~Copyable {} diff --git a/test/SILOptimizer/moveonly_borrowing_switch.swift b/test/SILOptimizer/moveonly_borrowing_switch.swift index 090c053500e20..d76a0fe50897d 100644 --- a/test/SILOptimizer/moveonly_borrowing_switch.swift +++ b/test/SILOptimizer/moveonly_borrowing_switch.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -emit-sil -verify -enable-experimental-feature BorrowingSwitch -disable-experimental-parser-round-trip %s +// RUN: %target-swift-frontend -emit-sil -verify -enable-experimental-feature BorrowingSwitch %s struct Payload: ~Copyable { var x: Int diff --git a/test/SILOptimizer/moveonly_borrowing_switch_copyable_subpattern.swift b/test/SILOptimizer/moveonly_borrowing_switch_copyable_subpattern.swift index 0a50d48bc1f1c..7307db6ea2140 100644 --- a/test/SILOptimizer/moveonly_borrowing_switch_copyable_subpattern.swift +++ b/test/SILOptimizer/moveonly_borrowing_switch_copyable_subpattern.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -emit-sil -verify -enable-experimental-feature BorrowingSwitch -disable-experimental-parser-round-trip %s +// RUN: %target-swift-frontend -emit-sil -verify -enable-experimental-feature BorrowingSwitch %s struct Payload: ~Copyable { var x: Int