6.0: [Features] Move NoncopyableGenerics up. #73847
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.
Explanation: Fix a condfail on MemoryLayout in the stdlib.
The
MemoryLayout
declaration involves bothNoncopyableGenerics
(its generic paramter need not conform toCopyable
) andConformanceSuppression
(inference of conformance toBitwiseCopyable
is repressed).Some compilers have
NoncopyableGenerics
but notConformanceSuppression
. The declarations in Features.def need to match the order in which features appeared in compilers. This is necesary because ASTPrinting assumes that if a compiler has a declared-later feature, it has all declared-earlier features.Previously,
NoncopyableGenerics
was declared afterConformanceSuppression
. That resulted inASTPrinting
assuming that all compilers which hadNoncopyableGenerics
also hadConformanceSuppression
. That isn't the case, however--as mentioned, some compilers haveNoncopyableGenerics
but notConformanceSuppression
.Here, this is fixed by declaring the
NoncopyableGenerics
feature earlier thanConformanceSuppression
in Features.def. The result is that ASTPrinting correctly assumes that if a compiler hasConformanceSuppression
it also hasNoncopyableGenerics
, but not the reverse.caused by NoncopyableGenerics being newer than ConformanceSuppression.
Scope: Very narrow. Affects declarations of types involving both
NoncopyableGenerics
andConformanceSuppression
in swiftinterfaces.Issue: rdar://128611158
Original PR: #73843
Risk: Very low.
Testing: Added a test which demonstrates the interface being printed as desired.
Reviewer: Allan Shortlidge ( @tshortli )