Skip to content

Commit 35a4175

Browse files
authored
Merge pull request #79557 from tshortli/warnings
Gardening: Fix various warnings
2 parents 4ba6070 + 972bc18 commit 35a4175

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,6 @@ Type DefaultArgumentTypeRequest::evaluate(Evaluator &evaluator,
13641364
DefaultArgumentInitializer *
13651365
DefaultArgumentInitContextRequest::evaluate(Evaluator &eval,
13661366
ParamDecl *param) const {
1367-
auto &ctx = param->getASTContext();
13681367
auto *parentDC = param->getDeclContext();
13691368
auto *paramList = getParameterList(cast<ValueDecl>(parentDC->getAsDecl()));
13701369

stdlib/public/Concurrency/Task.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ extension Task where Failure == Never {
766766

767767
var task: Builtin.NativeObject?
768768
#if $BuiltinCreateAsyncTaskName
769-
if var name {
769+
if let name {
770770
task =
771771
name.utf8CString.withUnsafeBufferPointer { nameBytes in
772772
Builtin.createTask(
@@ -935,27 +935,27 @@ self._task = task
935935

936936
var task: Builtin.NativeObject?
937937
#if $BuiltinCreateAsyncTaskName
938-
if var name {
939-
task =
940-
name.utf8CString.withUnsafeBufferPointer { nameBytes in
941-
Builtin.createTask(
942-
flags: flags,
943-
initialSerialExecutor: builtinSerialExecutor,
944-
taskName: nameBytes.baseAddress!._rawValue,
945-
operation: operation).0
946-
}
947-
}
938+
if let name {
939+
task =
940+
name.utf8CString.withUnsafeBufferPointer { nameBytes in
941+
Builtin.createTask(
942+
flags: flags,
943+
initialSerialExecutor: builtinSerialExecutor,
944+
taskName: nameBytes.baseAddress!._rawValue,
945+
operation: operation).0
946+
}
947+
}
948948
#endif
949-
if task == nil {
950-
// either no task name was set, or names are unsupported
951-
task = Builtin.createTask(
952-
flags: flags,
953-
initialSerialExecutor: builtinSerialExecutor,
954-
operation: operation).0
955-
}
949+
if task == nil {
950+
// either no task name was set, or names are unsupported
951+
task = Builtin.createTask(
952+
flags: flags,
953+
initialSerialExecutor: builtinSerialExecutor,
954+
operation: operation).0
955+
}
956956

957-
self._task = task!
958-
}
957+
self._task = task!
958+
}
959959
#endif
960960
}
961961

@@ -1076,7 +1076,7 @@ extension Task where Failure == Never {
10761076

10771077
var task: Builtin.NativeObject?
10781078
#if $BuiltinCreateAsyncTaskName
1079-
if var name {
1079+
if let name {
10801080
task =
10811081
name.utf8CString.withUnsafeBufferPointer { nameBytes in
10821082
Builtin.createTask(
@@ -1218,7 +1218,7 @@ extension Task where Failure == Error {
12181218

12191219
var task: Builtin.NativeObject?
12201220
#if $BuiltinCreateAsyncTaskName
1221-
if var name {
1221+
if let name {
12221222
task =
12231223
name.utf8CString.withUnsafeBufferPointer { nameBytes in
12241224
Builtin.createTask(

stdlib/public/Concurrency/TaskGroup+addTask.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ extension ${TYPE} {
243243
% # we definitely have the prior ones, as we always keep adding parameters.
244244
% if HAS_TASK_NAME:
245245
#if $BuiltinCreateAsyncTaskName
246-
if var name {
246+
if let name {
247247
task =
248248
name.utf8CString.withUnsafeBufferPointer { nameBytes in
249249
${TASK_CREATE_FN}(

stdlib/public/libexec/swift-backtrace/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ Generate a backtrace for the parent process.
551551
// If the output path is a directory, generate a filename
552552
let name = target!.name
553553
let pid = target!.pid
554-
var now = timespec()
554+
var now = timespec(tv_sec: 0, tv_nsec: 0)
555555

556556
if clock_gettime(CLOCK_REALTIME, &now) != 0 {
557557
now.tv_sec = time(nil)

0 commit comments

Comments
 (0)