Lower move-only wrapper types earlier to disable the TrivialMoveOnlyTypeEliminator pass. #71538
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.
This eliminates an in-between state where only some move-only wrapper types are removed. The long term fix is to teach SILGen to emit casts more precisely.
This fixes the
consuming
andborrowing
keywords for some basic cases. In particular, if a nontrivial struct contains a trivial 'let' field, then this pass would result in invalid SIL types:class C {}
struct BV {
let p: UnsafeRawPointer
let c: C
}
func getPointer(bv: consuming BV) -> UnsafeRawPointer {
return bv.p
}
Ultimately, this pass makes sense, but there is something strange about the way move-only-ness propagates into fields of aggregates which needs to be fixed first. Until then, other features are blocked on basic support for these keywords.
Fixes rdar://122701694 (
consuming
keyword causes verification error on invalid SIL types)Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves #NNNNN, fix apple/llvm-project#MMMMM.