Skip to content
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

Add missing Send/Sync impls #225

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Conversation

Imberflur
Copy link
Contributor

Forgot these in #223!

src/cell.rs Outdated
@@ -47,6 +47,10 @@ pub struct Ref<'a, T: ?Sized + 'a> {
value: NonNull<T>,
}

// SAFETY: `Ref<'_, T> acts as a reference.
unsafe impl<'a, T: ?Sized + 'a> Sync for Ref<'a, T> where T: Sync {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct, but can we express the bounds as where for<'a> &'a T: Sync and where for<'a> &'a T: Send instead so we're matching the impls with those of actual references?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amended commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I would like to double check if this works when T is not 'static

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine

@zesterer
Copy link
Contributor

Miri failure? Hopefully nothing important

@Imberflur
Copy link
Contributor Author

Miri failure? Hopefully nothing important

This is to be expected for now. MetaTable does some very questionable stuff with vtable pointers. I haven't ran into tests (in specs) that fail Miri due to this yet so I'm not focusing on it (but I would like to have reminder of Miri failing). Unfortunately, github CI lacks ability to have a CI check that is allowed to fail without showing red X https://github.com/orgs/community/discussions/15452. IIRC I think MetaTable is used for potential scripting support.

@zesterer zesterer merged commit 9708b7f into amethyst:master Feb 13, 2023
@Imberflur Imberflur deleted the trustcell-fix branch February 13, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants