Skip to content

[6.0] Fix build warnings #2751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/PerformanceTest/ParsingPerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ParsingPerformanceTests: XCTestCase {
func testNativeParsingPerformance() throws {
try XCTSkipIf(longTestsDisabled)

let source = try String(contentsOf: inputFile)
let source = try String(contentsOf: inputFile, encoding: .utf8)

try measureInstructions {
_ = Parser.parse(source: source)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SyntaxClassifierPerformanceTests: XCTestCase {
func testClassifierPerformance() throws {
try XCTSkipIf(longTestsDisabled)

let source = try String(contentsOf: inputFile)
let source = try String(contentsOf: inputFile, encoding: .utf8)
let parsed = Parser.parse(source: source)

try measureInstructions {
Expand Down
6 changes: 3 additions & 3 deletions Tests/PerformanceTest/VisitorPerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class VisitorPerformanceTests: XCTestCase {
try XCTSkipIf(longTestsDisabled)
class EmptyVisitor: SyntaxVisitor {}

let source = try String(contentsOf: inputFile)
let source = try String(contentsOf: inputFile, encoding: .utf8)
let parsed = Parser.parse(source: source)
let emptyVisitor = EmptyVisitor(viewMode: .sourceAccurate)

Expand All @@ -41,7 +41,7 @@ class VisitorPerformanceTests: XCTestCase {
try XCTSkipIf(longTestsDisabled)
class EmptyRewriter: SyntaxRewriter {}

let source = try String(contentsOf: inputFile)
let source = try String(contentsOf: inputFile, encoding: .utf8)
let parsed = Parser.parse(source: source)
let emptyRewriter = EmptyRewriter(viewMode: .sourceAccurate)

Expand All @@ -54,7 +54,7 @@ class VisitorPerformanceTests: XCTestCase {
try XCTSkipIf(longTestsDisabled)
class EmptyAnyVisitor: SyntaxAnyVisitor {}

let source = try String(contentsOf: inputFile)
let source = try String(contentsOf: inputFile, encoding: .utf8)
let parsed = Parser.parse(source: source)
let emptyVisitor = EmptyAnyVisitor(viewMode: .sourceAccurate)

Expand Down
8 changes: 1 addition & 7 deletions Tests/SwiftParserTest/ParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,14 @@ class ParserTests: ParserTestCase {
shouldExclude: @Sendable (URL) -> Bool = { _ in false }
) {
// nonisolated(unsafe) because [URL] is not marked Sendable on Linux.
let _fileURLs = FileManager.default
let fileURLs = FileManager.default
.enumerator(at: path, includingPropertiesForKeys: nil)!
.compactMap({ $0 as? URL })
.filter {
$0.pathExtension == "swift"
|| $0.pathExtension == "sil"
|| $0.pathExtension == "swiftinterface"
}
#if swift(>=6.0) && !canImport(Darwin)
// URL is not marked as Sendable in corelibs-foundation
nonisolated(unsafe) let fileURLs = _fileURLs
#else
let fileURLs = _fileURLs
#endif

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