[5.9][move-only] Fix lazily initialized global initializers. #67380
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.
• Description: Without this, we emit a copy of noncopyable type error since we do not insert a mark_must_check on lazily initialized global initializers.
The language impact is that without this when we write code like the following we emit a copyable of noncopyable type error since the checker does not actually run on the lazily initialized globals.
• Risk: Very low. The fix involves us inserting a mark_must_check on a specific code pattern that did not have a mark_must_check inserted. So this should only involve noncopyable types and further only when this very specific code pattern is emitted by SILGen. The fix is very localized.
• Original PR: #67354
• Reviewed By: @jckarter @atrick
• Testing: Added Swift and SIL tests
• Resolves: rdar://111402912