Skip to content

Commit 6d425fc

Browse files
authored
Merge pull request #80448 from tshortli/fix-more-warnings
Gardening: Fix more warnings
2 parents f31643b + 82e4e50 commit 6d425fc

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

lib/AST/ASTPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4521,7 +4521,7 @@ void PrintAST::visitSubscriptDecl(SubscriptDecl *decl) {
45214521
Printer.callPrintStructurePre(PrintStructureKind::FunctionReturnType);
45224522

45234523
if (!Options.SuppressSendingArgsAndResults) {
4524-
if (auto typeRepr = decl->getElementTypeRepr()) {
4524+
if (decl->getElementTypeRepr()) {
45254525
if (isa<SendingTypeRepr>(decl->getResultTypeRepr()))
45264526
Printer << "sending ";
45274527
}

lib/AST/ProtocolConformanceRef.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
9898

9999
// If the type is an opaque archetype, the conformance will remain abstract,
100100
// unless we're specifically substituting opaque types.
101-
if (auto origArchetype = origType->getAs<OpaqueTypeArchetypeType>()) {
101+
if (origType->getAs<OpaqueTypeArchetypeType>()) {
102102
if (!IFS.shouldSubstituteOpaqueArchetypes()) {
103103
return forAbstract(origType.subst(IFS), proto);
104104
}

lib/Macros/Sources/SwiftMacros/DistributedResolvableMacro.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extension DistributedResolvableMacro {
8080
if var variable = requirement.decl.as(VariableDeclSyntax.self) {
8181
variable.modifiers = variable.modifiers.filter { !$0.isAccessControl }
8282
access.reversed().forEach { modifier in
83-
variable.modifiers = variable.modifiers.prepending(modifier)
83+
variable.modifiers = [modifier] + variable.modifiers
8484
}
8585

8686
var accessorStubs: [String] = []
@@ -106,7 +106,7 @@ extension DistributedResolvableMacro {
106106
} else if var fun = requirement.decl.as(FunctionDeclSyntax.self) {
107107
fun.modifiers = fun.modifiers.filter { !$0.isAccessControl }
108108
access.reversed().forEach { modifier in
109-
fun.modifiers = fun.modifiers.prepending(modifier)
109+
fun.modifiers = [modifier] + fun.modifiers
110110
}
111111

112112
// normal function stub

lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -677,14 +677,14 @@ struct CountedOrSizedReturnPointerThunkBuilder: PointerBoundsThunkBuilder {
677677
if unsafe _resultValue == nil {
678678
return nil
679679
} else {
680-
return unsafe \(raw: try cast)(\(raw: startLabel): _resultValue!, count: Int(\(countExpr)))
680+
return unsafe \(raw: cast)(\(raw: startLabel): _resultValue!, count: Int(\(countExpr)))
681681
}
682682
}()
683683
"""
684684
}
685685
return
686686
"""
687-
unsafe \(raw: try cast)(\(raw: startLabel): \(call), count: Int(\(countExpr)))
687+
unsafe \(raw: cast)(\(raw: startLabel): \(call), count: Int(\(countExpr)))
688688
"""
689689
}
690690
}

lib/SIL/IR/SILConstants.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void SymbolicValue::print(llvm::raw_ostream &os, unsigned indent) const {
7171
SmallVector<char, 0> stringFloatRepr;
7272
getFloatValue().toString(stringFloatRepr);
7373
os << "float: " << stringFloatRepr << "\n";
74+
return;
7475
}
7576
case RK_String:
7677
os << "string: \"" << getStringValue() << "\"\n";

0 commit comments

Comments
 (0)