|
29 | 29 | #include "swift/AST/DiagnosticsSema.h" |
30 | 30 | #include "swift/AST/ExistentialLayout.h" |
31 | 31 | #include "swift/AST/GenericEnvironment.h" |
32 | | -#include "swift/AST/InverseMarking.h" |
33 | 32 | #include "swift/AST/NameLookup.h" |
34 | 33 | #include "swift/AST/NameLookupRequests.h" |
35 | 34 | #include "swift/AST/PackConformance.h" |
@@ -403,39 +402,6 @@ static ProtocolConformanceRef getBuiltinMetaTypeTypeConformance( |
403 | 402 | return ProtocolConformanceRef::forMissingOrInvalid(type, protocol); |
404 | 403 | } |
405 | 404 |
|
406 | | -static ProtocolConformanceRef |
407 | | -getBuiltinInvertibleProtocolConformance(NominalTypeDecl *nominal, |
408 | | - Type type, |
409 | | - ProtocolDecl *protocol) { |
410 | | - assert(isa<ClassDecl>(nominal)); |
411 | | - ASTContext &ctx = protocol->getASTContext(); |
412 | | - |
413 | | - auto ip = protocol->getInvertibleProtocolKind(); |
414 | | - switch (*ip) { |
415 | | - case InvertibleProtocolKind::Copyable: |
416 | | - // If move-only classes is enabled, we'll check the markings. |
417 | | - if (ctx.LangOpts.hasFeature(Feature::MoveOnlyClasses)) { |
418 | | - switch (nominal->hasInverseMarking(*ip).getKind()) { |
419 | | - case InverseMarking::Kind::LegacyExplicit: |
420 | | - case InverseMarking::Kind::Explicit: |
421 | | - // An inverse ~Copyable prevents conformance. |
422 | | - return ProtocolConformanceRef::forInvalid(); |
423 | | - |
424 | | - case InverseMarking::Kind::None: |
425 | | - break; |
426 | | - } |
427 | | - } |
428 | | - break; |
429 | | - case InvertibleProtocolKind::Escapable: |
430 | | - // Always conforms. |
431 | | - break; |
432 | | - } |
433 | | - |
434 | | - return ProtocolConformanceRef( |
435 | | - ctx.getBuiltinConformance(type, protocol, |
436 | | - BuiltinConformanceKind::Synthesized)); |
437 | | -} |
438 | | - |
439 | 405 | /// Synthesize a builtin type conformance to the given protocol, if |
440 | 406 | /// appropriate. |
441 | 407 | static ProtocolConformanceRef |
@@ -625,13 +591,6 @@ LookupConformanceInModuleRequest::evaluate( |
625 | 591 | if (!nominal || isa<ProtocolDecl>(nominal)) |
626 | 592 | return ProtocolConformanceRef::forMissingOrInvalid(type, protocol); |
627 | 593 |
|
628 | | - // We specially avoid recording conformances to invertible protocols in a |
629 | | - // class's conformance table. This prevents an evaluator cycle. |
630 | | - if (ctx.LangOpts.hasFeature(Feature::NoncopyableGenerics) |
631 | | - && isa<ClassDecl>(nominal) |
632 | | - && protocol->getInvertibleProtocolKind()) |
633 | | - return getBuiltinInvertibleProtocolConformance(nominal, type, protocol); |
634 | | - |
635 | 594 | // Expand conformances added by extension macros. |
636 | 595 | // |
637 | 596 | // FIXME: This expansion should only be done if the |
|
0 commit comments