Skip to content

Commit 6af7319

Browse files
JakobDegenfacebook-github-bot
authored andcommitted
Make Value<'v> not Send + Sync
Summary: It's not supposed to be, but that seems to have been accidentally broken/regressed at some time, which isn't great Requires a couple of adjustments to buck2, fortunately only trivial ones Reviewed By: cjhopman Differential Revision: D74113487 fbshipit-source-id: 2a6d76e629f1eb0e9ee63d9ec6ea76c86ca09caa
1 parent b26800c commit 6af7319

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

starlark/src/values/layout/pointer.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
// We group our bytes based on the tag info, not traditional alignment.
2525
#![allow(clippy::unusual_byte_groupings)]
2626

27-
use std::cell::Cell;
2827
use std::fmt::Debug;
2928
use std::marker::PhantomData;
3029
use std::mem;
@@ -159,9 +158,9 @@ impl RawPointer {
159158
#[derive(Clone, Copy, Dupe)]
160159
pub(crate) struct Pointer<'p> {
161160
ptr: RawPointer,
162-
// Make sure we are invariant in all the types/lifetimes.
161+
// Make sure we are invariant in all the types/lifetimes, and are not `Send` or `Sync`
163162
// See https://stackoverflow.com/questions/62659221/why-does-a-program-compile-despite-an-apparent-lifetime-mismatch
164-
_phantom: PhantomData<Cell<&'p AValueHeader>>,
163+
_phantom: PhantomData<*mut &'p ()>,
165164
}
166165

167166
// Similar to `Pointer` but allows widening lifetime, which is valid operation for frozen pointers.

0 commit comments

Comments
 (0)