Description
Sometimes it happens that two unsafe-using libraries are sound in isolation, but unsound when combined. Each time that happens, Rust has to decide which side to consider sound. Ultimately this boils down to precisely specifying the safety invariants of all our types -- but doing that requires something like RustBelt, so it is hard to have that discussion in full generality. (Also that would involve T-types at least as much as WG-UCG / T-opsem.)
But meanwhile, it would be good to collect the cases of these conflicts here that we find out there in the wild.
The most famous case of this is of course leakpocalypse: Rc
vs pre-Rust-1.0-scoped-threads, which famously got decided in favor of Rc
(and mem::forget
). Another case is that without union
and ManuallyDrop
, josephine
would be sound. Again the resolution for the ecosystem is clearly in favor of union
s and ManuallyDrop
.
The point of this thread is not to discuss any of these conflicts and figure out which side we want to bless. It is solely to collect the known cases in a central location.
- take_mut / replace_with vs partial-borrow: see here for details and discussion.
- mk_static vs Stack Tokens: see reddit for details.
Pin
is seriously under-specified and probably has quite a few of these conflicts, here is one.- "Partial move out of
Drop
type" vs a pattern that assumes that exactly that does not happen (coming up in this RFC). - TLS vs stackful coroutines.
- Allowing vs not allowing some lifetime subtyping on
dyn Trait
.
Activity
RalfJung commentedon Nov 24, 2022
I am pretty sure I saw another case of this recently, but forgot where...
oskgo commentedon Aug 23, 2023
RustyYato commentedon Aug 23, 2023
oskgo commentedon Aug 23, 2023
RustyYato commentedon Aug 23, 2023
RalfJung commentedon Aug 24, 2023
Jules-Bertholet commentedon Oct 7, 2023
RalfJung commentedon Oct 8, 2023
RalfJung commentedon Oct 8, 2023
steffahn commentedon Oct 28, 2023
RalfJung commentedon Oct 28, 2023
matklad commentedon Dec 11, 2023
RalfJung commentedon Dec 12, 2023
Jules-Bertholet commentedon Dec 13, 2023
adamreichold commentedon Dec 14, 2023
5 remaining items