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
Disallow !Sync
types in #[once]
fixtures
#237
Conversation
THX for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we can remove this external dependency and use std::sync::OnceLock
instead.
Moreover your changes to errors.rs
file introduce an annoying regression 😢. The compiler stop t show some of the errors in the first lines of the file... this kind of tests are fragile. I solved it by separate in 2 files: I'll share my branch if you like.
Finally, can you add a log line in changelog file?
You can find my branch here https://github.com/la10736/rstest/tree/temp-once-fixture-not-sync-types |
👍 I was not sure what the MSRV policy for
I only tested with nightly locally. 😊
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!! THX
!Sync
types must not be shared to different threads by reference.Note: This PR is an API break (because
!Sync
types were allowed before). If!Sync
types are required for#[once]
fixtures, they can be wrapped in aMutex
to prevent data races.This PR also bumps the MSRV to Rust 1.60 due to the usage of
once_cell
. Rust 1.60 was released on 2022-04-07.Resolves #235.