Merge pull request #69842 from kavon/ncgenerics-stdlib-building

[NCGenerics] more work towards getting the stdlib building
This commit is contained in:
Kavon Farvardin
2023-11-29 17:31:45 -08:00
committed by GitHub
18 changed files with 334 additions and 144 deletions

View File

@@ -1568,11 +1568,12 @@ ModuleDecl::lookupExistentialConformance(Type type, ProtocolDecl *protocol) {
if (!protocol->existentialConformsToSelf())
return ProtocolConformanceRef::forInvalid();
// All existentials are Copyable.
if (protocol->isSpecificProtocol(KnownProtocolKind::Copyable)) {
return ProtocolConformanceRef(
ctx.getBuiltinConformance(type, protocol,
BuiltinConformanceKind::Synthesized));
if (protocol->isSpecificProtocol(KnownProtocolKind::Copyable)
&& !ctx.LangOpts.hasFeature(Feature::NoncopyableGenerics)) {
// Prior to noncopyable generics, all existentials conform to Copyable.
return ProtocolConformanceRef(
ctx.getBuiltinConformance(type, protocol,
BuiltinConformanceKind::Synthesized));
}
auto layout = type->getExistentialLayout();