[6.4] IRGen/Runtime: emit noncopyable field metadata #89489
Merged
kavon merged 5 commits intoMay 28, 2026
Merged
Conversation
If our deployment target is a future release version (99.99+) then we would end up returning the latest known release version, e.g., 6.3. That seemed counter to the intention of eac9b3c and the description in `findSwiftRuntimeVersion`, which says we should return `std::nullopt` to indicate that we're not bound to any version. (cherry picked from commit c185332)
The VWT flags for isNonCopyable aren't always being set
correctly by the runtime when it is creating type metadata.
We can't always set them correctly, in the case of fixed-layout
types, as their VWT is static and read-only, yet could still be
conditionally copyable. For example:
```
struct FactoryOf<T: ~Copyable>: ~Copyable {
var counter: Int = 0
}
extension FactoryOf: Copyable where T: Copyable {}
```
In the common case of an unconditionally Copyable type, we do
effectively two quick bit-tests: one to see if the VWT thinks
it "could be Copyable" and then delegate to
`checkInvertibleRequirements` which has a fast-path for types
that are unconditionally Copyable by checking some bits in the
type's context descriptor.
related to rdar://176282041
(cherry picked from commit 0a73911)
At this point, the ReflectionMirror should be ready to handle Mirror attempting to reflect fields of noncopyable types. related to rdar://176282041 (cherry picked from commit 54dd201)
…typeref.swift test (swiftlang#89369) I'll try enabling again once we switch to the upcoming LTS NDK 30. (cherry picked from commit fbfe650)
(cherry picked from commit 2fa6613)
Member
Author
|
@swift-ci test |
adrian-prantl
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
mainPR to declare the 6.4 runtime as safe, once this 6.4 cherry-pick PR is merged: Establish NoncopyableReflectionSafety as present in 6.4 #89490