[swift/main] Migrate to internal imports #756
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry pick of #755.
As of the Swift 6 compiler,
@_implementationOnly import
is deprecated in favor ofinternal 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
andinternal import
are roughly functionally equivalent, aside from improved diagnostics forinternal import
. For non-resilient libraries, the main difference is thatinternal 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 aninternal 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.