@@ -4407,30 +4407,9 @@ void swift::performAbstractFuncDeclDiagnostics(AbstractFunctionDecl *AFD) {
44074407 }
44084408}
44094409
4410- static void
4411- diagnoseMoveOnlyPatternMatchSubject (ASTContext &C,
4412- const DeclContext *DC,
4413- Expr *subjectExpr) {
4414- // For now, move-only types must use the `consume` operator to be
4415- // pattern matched. Pattern matching is only implemented as a consuming
4416- // operation today, but we don't want to be stuck with that as the default
4417- // in the fullness of time when we get borrowing pattern matching later.
4418-
4419- // Don't bother if the subject wasn't given a valid type, or is a copyable
4420- // type.
4421- auto subjectType = subjectExpr->getType ();
4422- if (!subjectType
4423- || subjectType->hasError ()
4424- || !subjectType->isNoncopyable ()) {
4425- return ;
4426- }
4427- }
4428-
44294410// Perform MiscDiagnostics on Switch Statements.
44304411static void checkSwitch (ASTContext &ctx, const SwitchStmt *stmt,
44314412 DeclContext *DC) {
4432- diagnoseMoveOnlyPatternMatchSubject (ctx, DC, stmt->getSubjectExpr ());
4433-
44344413 // We want to warn about "case .Foo, .Bar where 1 != 100:" since the where
44354414 // clause only applies to the second case, and this is surprising.
44364415 for (auto cs : stmt->getCases ()) {
@@ -5184,9 +5163,7 @@ static void checkLabeledStmtConditions(ASTContext &ctx,
51845163
51855164 switch (elt.getKind ()) {
51865165 case StmtConditionElement::CK_Boolean:
5187- break ;
51885166 case StmtConditionElement::CK_PatternBinding:
5189- diagnoseMoveOnlyPatternMatchSubject (ctx, DC, elt.getInitializer ());
51905167 break ;
51915168 case StmtConditionElement::CK_Availability: {
51925169 auto info = elt.getAvailability ();
0 commit comments