Closed RalfJung closed 1 year ago
I expect the following to happen here:
I think this should be fixable :thinking:
Oh interesting, so this fails even when the pointers are not wide -- yes that definitely looks like a bug to me.
Closing as a duplicate of https://github.com/rust-lang/rust/issues/113257.
The following code compiles just fine:
This basically unsafely asserts that our underlying type is actually
Send
.However, strangely, the following code is rejected:
This does basically the same as the above, it unsafely assertions that our underlying type satisfies the
'static
bound. So I would expect both of these to be accepted. But somehow the borrow checker is getting in the way and says something about variance:To work around this, one has to use a
transmute
, and that's always a bad sign. This even happens in the standard library.Cc @rust-lang/types