Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
test:
runs-on: macos-14
runs-on: macos-latest

steps:
- uses: actions/checkout@v7
Expand All @@ -31,7 +31,7 @@ jobs:
- run: swift test -v

build:
runs-on: macos-14
runs-on: macos-latest
needs: [test]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.10
6.3.3
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ asynchronously (via `NSWorkspace.recycle`).
- `Sources/Trash/Trash.swift` — the entire app. `Trash.put` spins
`CFRunLoopRun()`/`CFRunLoopStop` to block on `NSWorkspace.recycle`'s
async-only completion handler — don't "simplify" this into an early return.
The `nonisolated(unsafe)` on `Trash.put`'s local `error` and on
`CLI.standardError` is safe, not dead code: `error` is only ever written
from inside the completion handler and only ever read after
`CFRunLoopRun()` returns, which the run loop guarantees happens after
that write; `standardError` is assigned once at startup and only ever
touched from `CLI.main()`'s single thread. Don't remove either
annotation — Swift 6 strict concurrency checking will fail to compile
without them.
- `Tests/TrashTests/TrashTests.swift` — XCTest suite.

## Build / test / run
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7.3
// swift-tools-version:6.3.3

import PackageDescription

Expand Down
4 changes: 2 additions & 2 deletions Sources/Trash/Trash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Usage: trash [file ...]

public struct Trash {
public static func put(_ paths: [String]) throws {
var error: NSError?
nonisolated(unsafe) var error: NSError?
let urls = paths.map(URL.init(fileURLWithPath:))
let loop = CFRunLoopGetCurrent()

Expand All @@ -35,7 +35,7 @@ extension FileHandle: TextOutputStream {

@main
struct CLI {
static var standardError = FileHandle.standardError
nonisolated(unsafe) static var standardError = FileHandle.standardError

static func main() {
let args = Array(CommandLine.arguments.dropFirst())
Expand Down
Loading