Skip to content

Use Never instead of Void as the fallback lock/mutex type. #898

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
Jan 8, 2025

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Jan 8, 2025

When using WASI without multithreading, or when using a platform to which Swift Testing has been incompletely ported, we don't know what type to use as a lock/mutex, so we use Void. However, turns out that produces a diagnostic:

warning: UnsafeMutablePointer has been replaced by UnsafeMutableRawPointer

So use Never instead. (Yes, this will produce a pointer to an uninitialized instance of Never. If this affects you, please read Porting.md!)

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

When using WASI without multithreading, or when using a platform to which Swift
Testing has been incompletely ported, we don't know what type to use as a
lock/mutex, so we use `Void`. However, turns out that produces a diagnostic:

> warning: UnsafeMutablePointer<Void> has been replaced by UnsafeMutableRawPointer

So use `Never` instead. (Yes, this will produce a pointer to an uninitialized
instance of `Never`. If this affects you, please read Porting.md!)
@grynspan grynspan added bug 🪲 Something isn't working workaround Workaround for an issue in another component (may need to revert later) wasi/wasm 🧭 WebAssembly support labels Jan 8, 2025
@grynspan grynspan added this to the Swift 6.x milestone Jan 8, 2025
@grynspan grynspan self-assigned this Jan 8, 2025
@grynspan
Copy link
Contributor Author

grynspan commented Jan 8, 2025

@swift-ci test

@grynspan grynspan merged commit 6783a1a into main Jan 8, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/locked-fallback-type-never branch January 8, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working wasi/wasm 🧭 WebAssembly support workaround Workaround for an issue in another component (may need to revert later)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants