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

epoch: Fix stacked borrows violations #871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Jul 20, 2022

Fixes #545

See #545 (comment) for the reported stacked borrows violations.

Note: this is a breaking change because changes API of Pointable trait

@taiki-e taiki-e marked this pull request as draft July 20, 2022 02:00
@taiki-e taiki-e marked this pull request as ready for review July 21, 2022 01:20
@taiki-e taiki-e force-pushed the epoch-fix-sb-violations branch 3 times, most recently from f25a4cd to a81e099 Compare July 22, 2022 15:24
bors bot added a commit that referenced this pull request Jul 23, 2022
796: epoch: Remove ptr-to-int casts r=taiki-e a=taiki-e

Use [this hack](rust-lang/miri#1866 (comment)) to fix compatibility issues with Miri (see #490 (comment) for details). 

Due to the #545, still not compatible with stacked borrows. This will be fixed by the subsequent PR (#871).

Note: this is a breaking change because changes API of Pointable and Pointer traits

Fixes #579

881: Remove deprecated items r=taiki-e a=taiki-e

This removes the following deprecated items:

- crossbeam-epoch:
  - `CompareAndSetError`
  - `CompareAndSetOrdering`
  - `Atomic::compare_and_set`
  - `Atomic::compare_and_set_weak`
- crossbeam-utils:
  - `AtomicCell::compare_and_swap`

Co-authored-by: Taiki Endo <[email protected]>
bors bot added a commit that referenced this pull request Jul 23, 2022
796: epoch: Remove ptr-to-int casts r=taiki-e a=taiki-e

Use [this hack](rust-lang/miri#1866 (comment)) to fix compatibility issues with Miri (see #490 (comment) for details). 

Due to the #545, still not compatible with stacked borrows. This will be fixed by the subsequent PR (#871).

Note: this is a breaking change because changes API of Pointable and Pointer traits

Fixes #579

Co-authored-by: Taiki Endo <[email protected]>
@taiki-e taiki-e requested a review from jeehoonkang July 23, 2022 10:53
@taiki-e taiki-e force-pushed the epoch-fix-sb-violations branch 2 times, most recently from a8485b4 to f93970c Compare July 23, 2022 12:06
/// - `ptr` should not be mutably dereferenced by [`Pointable::deref_mut`] concurrently.
unsafe fn deref<'a>(ptr: *mut ()) -> &'a Self;
/// - `ptr` should not be mutably dereferenced by [`Pointable::as_mut_ptr`] concurrently.
unsafe fn as_ptr(ptr: *mut ()) -> *const Self;

/// Mutably dereferences the given pointer.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is no longer a dereference, but I'm not sure what is a good API name and description.

@taiki-e
Copy link
Member Author

taiki-e commented Jun 17, 2023

(Given that Miri appears to be trying to move to TB in the long term, I don't see the need to rush to merge this.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

epoch: Miri reports SB violation
1 participant