@@ -4425,30 +4425,9 @@ void swift::performAbstractFuncDeclDiagnostics(AbstractFunctionDecl *AFD) {
4425
4425
}
4426
4426
}
4427
4427
4428
- static void
4429
- diagnoseMoveOnlyPatternMatchSubject (ASTContext &C,
4430
- const DeclContext *DC,
4431
- Expr *subjectExpr) {
4432
- // For now, move-only types must use the `consume` operator to be
4433
- // pattern matched. Pattern matching is only implemented as a consuming
4434
- // operation today, but we don't want to be stuck with that as the default
4435
- // in the fullness of time when we get borrowing pattern matching later.
4436
-
4437
- // Don't bother if the subject wasn't given a valid type, or is a copyable
4438
- // type.
4439
- auto subjectType = subjectExpr->getType ();
4440
- if (!subjectType
4441
- || subjectType->hasError ()
4442
- || !subjectType->isNoncopyable ()) {
4443
- return ;
4444
- }
4445
- }
4446
-
4447
4428
// Perform MiscDiagnostics on Switch Statements.
4448
4429
static void checkSwitch (ASTContext &ctx, const SwitchStmt *stmt,
4449
4430
DeclContext *DC) {
4450
- diagnoseMoveOnlyPatternMatchSubject (ctx, DC, stmt->getSubjectExpr ());
4451
-
4452
4431
// We want to warn about "case .Foo, .Bar where 1 != 100:" since the where
4453
4432
// clause only applies to the second case, and this is surprising.
4454
4433
for (auto cs : stmt->getCases ()) {
@@ -5206,9 +5185,7 @@ static void checkLabeledStmtConditions(ASTContext &ctx,
5206
5185
5207
5186
switch (elt.getKind ()) {
5208
5187
case StmtConditionElement::CK_Boolean:
5209
- break ;
5210
5188
case StmtConditionElement::CK_PatternBinding:
5211
- diagnoseMoveOnlyPatternMatchSubject (ctx, DC, elt.getInitializer ());
5212
5189
break ;
5213
5190
case StmtConditionElement::CK_Availability: {
5214
5191
auto info = elt.getAvailability ();
0 commit comments