Skip to content

Sound ways to work with self-referential futures #380

@GoldsteinE

Description

@GoldsteinE

Hi! I have relatively complex code that passed Miri previously but doesn’t pass it now.

The failing job is:
https://github.com/GoldsteinE/name-it/actions/runs/3594297524/jobs/6052384905

TL;DR: I’m doing something like this:

let x: Fut = async_function();
let y: [MaybeUninit<u8>; size_of::<Fut>()] = transmute(x);
let p = pin!(y); // Causes a retag!
let z: Pin<&mut Fut> = transmute(p);
z.poll();

As far as I understood, this is a general issue with soundness of futures (rust-lang/rust#63818). I’d be grateful for any pointers to things I could do to resolve this issue in my case on my side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions