Skip to content

Commit 9e1684a

Browse files
authored
Merge pull request #15086 from slavapestov/small-scale-gardening
Clean up warnings
2 parents d502357 + 76349a0 commit 9e1684a

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,7 +3288,7 @@ void RewriteTreeNode::mergeIntoRec(
32883288
for (auto child : children)
32893289
child->mergeIntoRec(other, matchPath);
32903290

3291-
if (auto assocType = getMatch())
3291+
if (getMatch())
32923292
matchPath.pop_back();
32933293
}
32943294

@@ -3646,8 +3646,6 @@ static Type substituteConcreteType(GenericSignatureBuilder &builder,
36463646
proto, parentType, ProtocolConformanceRef(proto));
36473647

36483648
type = type.subst(subMap, SubstFlags::UseErrorType);
3649-
if (!type)
3650-
return ErrorType::get(proto->getASTContext());
36513649
} else {
36523650
// Substitute in the superclass type.
36533651
auto superclass = basePA->getEquivalenceClassIfPresent()->superclass;

lib/IDE/CodeCompletion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4024,7 +4024,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
40244024
}
40254025

40264026
return getPositionInTupleExpr(DC, CCExpr, tuple, Position, HasName);
4027-
} else if (auto *paren = dyn_cast<ParenExpr>(CallE->getArg())) {
4027+
} else if (isa<ParenExpr>(CallE->getArg())) {
40284028
HasName = false;
40294029
Position = 0;
40304030
return true;

lib/IRGen/LoadableByAddress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static bool containsFunctionSignature(GenericEnvironment *genEnv,
123123
if (auto optionalObject = objectType.getOptionalObjectType()) {
124124
objectType = optionalObject;
125125
}
126-
if (auto fnType = objectType.getAs<SILFunctionType>()) {
126+
if (objectType.is<SILFunctionType>()) {
127127
return true;
128128
}
129129
}

lib/SIL/InstructionUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ FindClosureResult swift::findClosureForAppliedArg(SILValue V) {
537537
if (auto *bbi = dyn_cast<BeginBorrowInst>(V))
538538
V = bbi->getOperand();
539539

540-
if (auto optionalObjTy = V->getType().getOptionalObjectType())
540+
if (V->getType().getOptionalObjectType())
541541
V = cast<EnumInst>(V)->getOperand();
542542

543543
auto fnType = V->getType().getAs<SILFunctionType>();

lib/SILOptimizer/Mandatory/DiagnoseStaticExclusivity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static void checkNoEscapePartialApply(PartialApplyInst *PAI) {
10411041
uses.append(EI->getUses().begin(), EI->getUses().end());
10421042
continue;
10431043
}
1044-
if (auto apply = isa<ApplySite>(user)) {
1044+
if (isa<ApplySite>(user)) {
10451045
SILValue arg = oper->get();
10461046
auto ArgumentFnType = getSILFunctionTypeForValue(arg);
10471047
if (ArgumentFnType && ArgumentFnType->isNoEscape()) {

0 commit comments

Comments
 (0)