4 ms·
If you have an object that's !Unpin, then Miri will not apply uniqueness rules to anything containing it [0], including boxes and &mut references. (In the examp
by LegionMammal978 2y ago
If you have an object that's !Unpin, then Miri will not apply uniqueness rules to anything containing it [0], including boxes and &mut references. (In the example code, replacing the PhantomPinned with a () will make Miri complain again.) This is considered a temporary (if long-lived) measure to allow async executors to manipulate pinned futures without invalidating all their internal borrows. Thus, it might be seen as undetected UB, in lieu of a permanent solution.
[0] https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=56500ae2945bb186030c5e51bda601c6 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- mmastrac 2y agoI forgot about this. I actually had to ignore a test in Miri because of this exact issue. https://github.com/denoland/deno_core/blob/98b09fa4f77db11312d993eb8b32ca905cf58fb7/core/runtime/op_driver/erased_future.rs#L179 https://github.com/denoland/deno_core/blob/98b09fa4f77db1131... Anxiously waiting on https://github.com/rust-lang/rfcs/pull/3467 https://github.com/rust-lang/rfcs/pull/3467