Skip to content

Commit cddc4db

Browse files
authored
Merge pull request #2750 from ahoppen/fix-warnings
Fix build warnings
2 parents 69909d6 + 3fc5690 commit cddc4db

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

Sources/SwiftRefactor/SyntaxUtils.swift

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

1313
#if swift(>=6)
14-
public import SwiftSyntax
14+
internal import SwiftSyntax
1515
#else
1616
import SwiftSyntax
1717
#endif

Tests/PerformanceTest/ParsingPerformanceTests.swift

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,14 @@ class ParserTests: ParserTestCase {
6161
checkDiagnostics: Bool,
6262
shouldExclude: @Sendable (URL) -> Bool = { _ in false }
6363
) {
64-
// nonisolated(unsafe) because [URL] is not marked Sendable on Linux.
65-
let _fileURLs = FileManager.default
64+
let fileURLs = FileManager.default
6665
.enumerator(at: path, includingPropertiesForKeys: nil)!
6766
.compactMap({ $0 as? URL })
6867
.filter {
6968
$0.pathExtension == "swift"
7069
|| $0.pathExtension == "sil"
7170
|| $0.pathExtension == "swiftinterface"
7271
}
73-
#if swift(>=6.0)
74-
nonisolated(unsafe) let fileURLs = _fileURLs
75-
#else
76-
let fileURLs = _fileURLs
77-
#endif
7872

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

0 commit comments

Comments
 (0)