Skip to content

Commit 19d4680

Browse files
authored
Merge pull request swiftlang#8235 from hughbe/unused-lambda-capture
2 parents 3ef5ef0 + d987952 commit 19d4680

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3698,7 +3698,7 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
36983698
// to the next.
36993699
// FIXME: Distinguish between explicit and inferred here?
37003700
auto otherPA = nextAnchor->anchor;
3701-
deferredSameTypeRequirement = [&f, archetype, otherPA, this] {
3701+
deferredSameTypeRequirement = [&f, archetype, otherPA] {
37023702
f(RequirementKind::SameType, archetype, otherPA,
37033703
RequirementSource::forAbstract(archetype));
37043704
};

lib/Driver/DependencyGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ LoadResult DependencyGraphImpl::loadFromBuffer(const void *node,
251251
};
252252

253253
auto providesCallback =
254-
[this, node, &provides](StringRef name, DependencyKind kind,
254+
[&provides](StringRef name, DependencyKind kind,
255255
bool isCascading) -> LoadResult {
256256
assert(isCascading);
257257
auto iter = std::find_if(provides.begin(), provides.end(),

lib/Parse/ParseSIL.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4396,8 +4396,7 @@ bool Parser::parseDeclSIL() {
43964396
FunctionState.ParsedTypeCallback = OldParsedTypeCallback;
43974397
};
43984398

4399-
FunctionState.ParsedTypeCallback = [&OpenedArchetypesTracker,
4400-
&FunctionState](Type ty) {
4399+
FunctionState.ParsedTypeCallback = [&OpenedArchetypesTracker](Type ty) {
44014400
OpenedArchetypesTracker.registerUsedOpenedArchetypes(
44024401
ty->getCanonicalType());
44034402
};

lib/PrintAsObjC/PrintAsObjC.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
13881388
void printCollectionElement(Type ty) {
13891389
ASTContext &ctx = M.getASTContext();
13901390

1391-
auto isSwiftNewtype = [&ctx](const StructDecl *SD) -> bool {
1391+
auto isSwiftNewtype = [](const StructDecl *SD) -> bool {
13921392
if (!SD)
13931393
return false;
13941394
auto *clangDecl = SD->getClangDecl();
@@ -2577,8 +2577,8 @@ class ModuleWriter {
25772577
// alphabetically first.
25782578
auto mismatch =
25792579
std::mismatch(lhsProtos.begin(), lhsProtos.end(), rhsProtos.begin(),
2580-
[getSortName] (const ProtocolDecl *nextLHSProto,
2581-
const ProtocolDecl *nextRHSProto) {
2580+
[] (const ProtocolDecl *nextLHSProto,
2581+
const ProtocolDecl *nextRHSProto) {
25822582
return nextLHSProto->getName() != nextRHSProto->getName();
25832583
});
25842584
if (mismatch.first == lhsProtos.end())

lib/SILOptimizer/Transforms/SpeculativeDevirtualizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static bool tryToSpeculateTarget(FullApplySite AI,
397397
// specific bound class.
398398
auto RemovedIt = std::remove_if(Subs.begin(),
399399
Subs.end(),
400-
[&ClassType, &M](ClassDecl *Sub){
400+
[&ClassType](ClassDecl *Sub){
401401
auto SubCanTy = Sub->getDeclaredType()->getCanonicalType();
402402
// Unbound generic type can override a method from
403403
// a bound generic class, but this unbound generic

lib/SILOptimizer/Utils/Devirtualize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void getAllSubclasses(ClassHierarchyAnalysis *CHA,
6767
// Filter out any subclasses that do not inherit from this
6868
// specific bound class.
6969
auto RemovedIt = std::remove_if(Subs.begin(), Subs.end(),
70-
[&ClassType, &M](ClassDecl *Sub){
70+
[&ClassType](ClassDecl *Sub){
7171
auto SubCanTy = Sub->getDeclaredType()->getCanonicalType();
7272
// Unbound generic type can override a method from
7373
// a bound generic class, but this unbound generic

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ RequirementEnvironment::RequirementEnvironment(
10371037
GenericTypeParamType::get(depth, genericParam->getIndex(), ctx);
10381038
return substGenericParam;
10391039
},
1040-
[selfType, concreteType, conformance, conformanceDC, &ctx, &tc](
1040+
[selfType, concreteType, conformance, conformanceDC, &ctx](
10411041
CanType type, Type replacement, ProtocolType *protoType)
10421042
-> Optional<ProtocolConformanceRef> {
10431043
auto proto = protoType->getDecl();
@@ -2496,7 +2496,7 @@ void ConformanceChecker::recordTypeWitness(AssociatedTypeDecl *assocType,
24962496
// Avoid relying on the lifetime of 'this'.
24972497
const DeclContext *DC = this->DC;
24982498
diagnoseOrDefer(assocType, false,
2499-
[DC, typeDecl, requiredAccessScope, assocType](
2499+
[DC, typeDecl, requiredAccessScope](
25002500
NormalProtocolConformance *conformance) {
25012501
Accessibility requiredAccess =
25022502
requiredAccessScope.requiredAccessibilityForDiagnostics();

0 commit comments

Comments
 (0)