Skip to content

Commit 686ef93

Browse files
committed
Migrate to internal imports.
As of the Swift 6 compiler, `@_implementationOnly import` is deprecated in favor of `internal import` and as a result the use of `@_implementationOnly import` in this project is generating a lot of diagnostic noise when building the Swift standard library. For Swift libraries with library evolution, `@_implementationOnly import` and `internal import` are roughly functionally equivalent, aside from improved diagnostics for `internal import`. For non-resilient libraries, the main difference is that `internal import` does not actually hide a module dependency from downstream clients because the layout of a type in a non-resilient library may depend on types coming from an `internal import` (with `@_implementationOnly import` the same situation would result in a silent mis-compile, which is the reason that `@_implementationOnly import` is deprecated). The `_RegexParser` module dependency does not need to be hidden from clients since it is installed in standard locations in the SDK/toolchain. Therefore this migration should be safe, regardless of library resilience mode.
1 parent 816989e commit 686ef93

27 files changed

+27
-27
lines changed

Sources/RegexBenchmark/Benchmark.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@_spi(RegexBenchmark) import _StringProcessing
2-
@_implementationOnly import _RegexParser
2+
internal import _RegexParser
33
import Foundation
44

55
protocol RegexBenchmark: Debug {

Sources/RegexBuilder/Anchor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313
@_spi(RegexBuilder) import _StringProcessing
1414

1515
/// A regex component that matches a specific condition at a particular position

Sources/RegexBuilder/CharacterClass.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313
@_spi(RegexBuilder) import _StringProcessing
1414

1515
/// A class of characters that match in a regex.

Sources/RegexBuilder/DSL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313
@_spi(RegexBuilder) import _StringProcessing
1414

1515
@available(SwiftStdlib 5.7, *)

Sources/_StringProcessing/ByteCodeGen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@_spi(_Unicode)
1313
import Swift
1414

15-
@_implementationOnly import _RegexParser
15+
internal import _RegexParser
1616

1717
extension Compiler {
1818
struct ByteCodeGen {

Sources/_StringProcessing/Capture.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313

1414
// TODO: Where should this live? Inside TypeConstruction?
1515
func constructExistentialOutputComponent(

Sources/_StringProcessing/Compiler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313

1414
class Compiler {
1515
let tree: DSLTree

Sources/_StringProcessing/ConsumerInterface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313

1414
extension Character {
1515
var _singleScalarAsciiValue: UInt8? {

Sources/_StringProcessing/Engine/InstPayload.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser
12+
internal import _RegexParser
1313

1414
extension Instruction {
1515
/// An instruction's payload packs operands and destination

Sources/_StringProcessing/Engine/MEBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import _RegexParser // For errors
12+
internal import _RegexParser // For errors
1313

1414
extension MEProgram {
1515
struct Builder {

0 commit comments

Comments
 (0)