@@ -4407,30 +4407,9 @@ void swift::performAbstractFuncDeclDiagnostics(AbstractFunctionDecl *AFD) {
4407
4407
}
4408
4408
}
4409
4409
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
-
4429
4410
// Perform MiscDiagnostics on Switch Statements.
4430
4411
static void checkSwitch (ASTContext &ctx, const SwitchStmt *stmt,
4431
4412
DeclContext *DC) {
4432
- diagnoseMoveOnlyPatternMatchSubject (ctx, DC, stmt->getSubjectExpr ());
4433
-
4434
4413
// We want to warn about "case .Foo, .Bar where 1 != 100:" since the where
4435
4414
// clause only applies to the second case, and this is surprising.
4436
4415
for (auto cs : stmt->getCases ()) {
@@ -5184,9 +5163,7 @@ static void checkLabeledStmtConditions(ASTContext &ctx,
5184
5163
5185
5164
switch (elt.getKind ()) {
5186
5165
case StmtConditionElement::CK_Boolean:
5187
- break ;
5188
5166
case StmtConditionElement::CK_PatternBinding:
5189
- diagnoseMoveOnlyPatternMatchSubject (ctx, DC, elt.getInitializer ());
5190
5167
break ;
5191
5168
case StmtConditionElement::CK_Availability: {
5192
5169
auto info = elt.getAvailability ();
0 commit comments