Skip to content

Commit c73ecd0

Browse files
committed
[NFC] BitwiseCopyable: Use getKnownProtocolKind.
Rather than getting ahold of the BitwiseCopyable protocol and doing a pointer comparison to another ProtocolDecl, check whether the latter's known protocol kind is ::BitwiseCopyable.
1 parent d192a83 commit c73ecd0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/Sema/TypeCheckDecl.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,8 @@ ExistentialConformsToSelfRequest::evaluate(Evaluator &evaluator,
690690
// Marker protocols always self-conform.
691691
if (decl->isMarkerProtocol()) {
692692
// Except for BitwiseCopyable an existential of which is non-trivial.
693-
auto *bitwiseCopyableProtocol =
694-
decl->getASTContext().getProtocol(KnownProtocolKind::BitwiseCopyable);
695693
if (decl->getASTContext().LangOpts.hasFeature(Feature::BitwiseCopyable) &&
696-
decl == bitwiseCopyableProtocol) {
694+
decl->getKnownProtocolKind() == KnownProtocolKind::BitwiseCopyable) {
697695
return false;
698696
}
699697
return true;

0 commit comments

Comments
 (0)