Skip to content

Commit 38f72fa

Browse files
committed
[utils] swift-xcodegen: Make a couple of types noncopyable
1 parent 87a0f5e commit 38f72fa

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

utils/swift-xcodegen/Sources/SwiftXcodeGen/Generator/ClangTarget.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
struct ClangTarget {
13+
struct ClangTarget: ~Copyable {
1414
var name: String
1515
var parentPath: RelativePath
1616
var sources: [RelativePath]

utils/swift-xcodegen/Sources/SwiftXcodeGen/Generator/ProjectGenerator.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fileprivate final class ProjectGenerator {
100100
}
101101
}
102102

103-
init(for spec: ProjectSpec) {
103+
init(for spec: consuming ProjectSpec) {
104104
self.spec = spec
105105

106106
// Create an 'ALL' meta-target that depends on everything.
@@ -361,7 +361,7 @@ fileprivate final class ProjectGenerator {
361361

362362
/// Checks whether a given Clang target can be represented using a buildable
363363
/// folder.
364-
func canUseBuildableFolder(for clangTarget: ClangTarget) throws -> Bool {
364+
func canUseBuildableFolder(for clangTarget: borrowing ClangTarget) throws -> Bool {
365365
try canUseBuildableFolder(
366366
at: clangTarget.parentPath,
367367
sources: clangTarget.sources + clangTarget.unbuildableSources
@@ -410,7 +410,7 @@ fileprivate final class ProjectGenerator {
410410
}
411411
}
412412

413-
func generateClangTarget(_ targetInfo: ClangTarget) throws {
413+
func generateClangTarget(_ targetInfo: consuming ClangTarget) throws {
414414
let targetPath = targetInfo.parentPath
415415
guard checkNotExcluded(targetPath, for: "Clang target") else {
416416
return
@@ -910,7 +910,7 @@ fileprivate final class ProjectGenerator {
910910
}
911911

912912
extension ProjectSpec {
913-
public func generateAndWrite(
913+
public consuming func generateAndWrite(
914914
into outputDir: AbsolutePath
915915
) throws -> GeneratedProject {
916916
let generator = ProjectGenerator(for: self)

utils/swift-xcodegen/Sources/SwiftXcodeGen/Generator/ProjectSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
/// The specification for a project to generate.
14-
public struct ProjectSpec {
14+
public struct ProjectSpec: ~Copyable {
1515
public var name: String
1616
public var buildDir: RepoBuildDir
1717
public var runnableBuildDir: RepoBuildDir

0 commit comments

Comments
 (0)