Skip to content

Commit 82a453c

Browse files
authored
Merge pull request #2751 from ahoppen/6.0/fix-build-warnings
[6.0] Fix build warnings
2 parents 19ff4a1 + c30b75b commit 82a453c

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

Tests/PerformanceTest/ParsingPerformanceTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ParsingPerformanceTests: XCTestCase {
2727
func testNativeParsingPerformance() throws {
2828
try XCTSkipIf(longTestsDisabled)
2929

30-
let source = try String(contentsOf: inputFile)
30+
let source = try String(contentsOf: inputFile, encoding: .utf8)
3131

3232
try measureInstructions {
3333
_ = Parser.parse(source: source)

Tests/PerformanceTest/SyntaxClassifierPerformanceTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SyntaxClassifierPerformanceTests: XCTestCase {
2828
func testClassifierPerformance() throws {
2929
try XCTSkipIf(longTestsDisabled)
3030

31-
let source = try String(contentsOf: inputFile)
31+
let source = try String(contentsOf: inputFile, encoding: .utf8)
3232
let parsed = Parser.parse(source: source)
3333

3434
try measureInstructions {

Tests/PerformanceTest/VisitorPerformanceTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class VisitorPerformanceTests: XCTestCase {
2828
try XCTSkipIf(longTestsDisabled)
2929
class EmptyVisitor: SyntaxVisitor {}
3030

31-
let source = try String(contentsOf: inputFile)
31+
let source = try String(contentsOf: inputFile, encoding: .utf8)
3232
let parsed = Parser.parse(source: source)
3333
let emptyVisitor = EmptyVisitor(viewMode: .sourceAccurate)
3434

@@ -41,7 +41,7 @@ class VisitorPerformanceTests: XCTestCase {
4141
try XCTSkipIf(longTestsDisabled)
4242
class EmptyRewriter: SyntaxRewriter {}
4343

44-
let source = try String(contentsOf: inputFile)
44+
let source = try String(contentsOf: inputFile, encoding: .utf8)
4545
let parsed = Parser.parse(source: source)
4646
let emptyRewriter = EmptyRewriter(viewMode: .sourceAccurate)
4747

@@ -54,7 +54,7 @@ class VisitorPerformanceTests: XCTestCase {
5454
try XCTSkipIf(longTestsDisabled)
5555
class EmptyAnyVisitor: SyntaxAnyVisitor {}
5656

57-
let source = try String(contentsOf: inputFile)
57+
let source = try String(contentsOf: inputFile, encoding: .utf8)
5858
let parsed = Parser.parse(source: source)
5959
let emptyVisitor = EmptyAnyVisitor(viewMode: .sourceAccurate)
6060

Tests/SwiftParserTest/ParserTests.swift

+1-7
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,14 @@ class ParserTests: ParserTestCase {
6262
shouldExclude: @Sendable (URL) -> Bool = { _ in false }
6363
) {
6464
// nonisolated(unsafe) because [URL] is not marked Sendable on Linux.
65-
let _fileURLs = FileManager.default
65+
let fileURLs = FileManager.default
6666
.enumerator(at: path, includingPropertiesForKeys: nil)!
6767
.compactMap({ $0 as? URL })
6868
.filter {
6969
$0.pathExtension == "swift"
7070
|| $0.pathExtension == "sil"
7171
|| $0.pathExtension == "swiftinterface"
7272
}
73-
#if swift(>=6.0) && !canImport(Darwin)
74-
// URL is not marked as Sendable in corelibs-foundation
75-
nonisolated(unsafe) let fileURLs = _fileURLs
76-
#else
77-
let fileURLs = _fileURLs
78-
#endif
7973

8074
print("\(name) - processing \(fileURLs.count) source files")
8175
DispatchQueue.concurrentPerform(iterations: fileURLs.count) { fileURLIndex in

0 commit comments

Comments
 (0)