[5.9🍒] Batch of small noncopyable type fixes #65912
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.
Pick of
discard
in generic noncopyable type #65896discard
fixes in Sema #65931• Description: Fixes small Sema bug preventing
discard
statements in generic noncopyable types.• Risk: Low. Expands the kinds of code permitted by compiler.
• Original PR: #65896 and one commit of #65931
• Reviewed By: @slavapestov, @jckarter
• Testing: tests included
• Resolves: rdar://108975216
• Description: Subscripts today don't support any form of ownership specifier for its parameters. Since noncopyable types require such a specifier, it's not helpful to emit an error suggesting to add the specifier. Instead, just say that noncopyable types can't be parameters of a subscript.
• Risk: Low. replaces one error diagnostic with a different one that has no fix-it.
• Original PR: #65898
• Reviewed By: @jckarter
• Testing: tests included
• Resolves: rdar://109233314
• Description: Prevent
discard `self`
from being permitted• Risk: Low. I doubt anybody was skirting around the discard self restriction with
let `self` = x
• Original PR: one commit of #65931
• Reviewed By: @jckarter
• Testing: tests included
• Resolves: rdar://109376381